Merge pull request #5 from claranet/feat/newest-distrib-support
feat: newest distrib support
This commit is contained in:
commit
9cf80214ee
107
.ansible-lint
107
.ansible-lint
@ -9,60 +9,58 @@ parseable: true
|
||||
use_default_rules: true
|
||||
|
||||
enable_list:
|
||||
command-shell: # Specific to use of command and shell modules
|
||||
- command-instead-of-module
|
||||
- command-instead-of-shell
|
||||
- deprecated-command-syntax
|
||||
- inline-env-var
|
||||
- no-changed-when
|
||||
- risky-shell-pipe
|
||||
core: # Related to internal implementation of the linter
|
||||
- internal-error
|
||||
- load-failure
|
||||
- parser-error
|
||||
- syntax-check
|
||||
deprecations: # Indicate use of features that are removed from Ansible
|
||||
- deprecated-bare-vars
|
||||
- deprecated-command-syntax
|
||||
- deprecated-local-action
|
||||
- deprecated-module
|
||||
- no-jinja-when
|
||||
- role-name
|
||||
formatting: # Related to code-style
|
||||
- no-jinja-nesting
|
||||
- no-tabs
|
||||
- playbook-extension
|
||||
- risky-octal
|
||||
- var-spacing
|
||||
- yaml
|
||||
idempotency: # Possible indication that consequent runs would produce different results
|
||||
- git-latest
|
||||
- hg-latest
|
||||
- no-changed-when
|
||||
- package-latest
|
||||
idiom: # Anti-pattern detected, likely to cause undesired behavior
|
||||
- command-instead-of-module
|
||||
- command-instead-of-shell
|
||||
- empty-string-compare
|
||||
- inline-env-var
|
||||
- literal-compare
|
||||
- no-handler
|
||||
- no-loop-var-prefix
|
||||
- no-relative-paths
|
||||
- unnamed-task
|
||||
- var-naming
|
||||
metadata: # Invalid metadata, likely related to galaxy, collections or roles
|
||||
- meta-incorrect
|
||||
- meta-no-tags
|
||||
- meta-video-links
|
||||
- role-name
|
||||
unpredictability:
|
||||
- ignore-errors
|
||||
- partial-become
|
||||
unskippable:
|
||||
- syntax-check
|
||||
yaml: # External linter which will also produce its own rule codes.
|
||||
- yaml
|
||||
# Specific to use of command and shell modules
|
||||
- command-instead-of-module
|
||||
- command-instead-of-shell
|
||||
- deprecated-command-syntax
|
||||
- inline-env-var
|
||||
- no-changed-when
|
||||
- risky-shell-pipe
|
||||
# Related to internal implementation of the linter
|
||||
- internal-error
|
||||
- load-failure
|
||||
- parser-error
|
||||
- syntax-check
|
||||
# Indicate use of features that are removed from Ansible
|
||||
- deprecated-bare-vars
|
||||
- deprecated-command-syntax
|
||||
- deprecated-local-action
|
||||
- deprecated-module
|
||||
- no-jinja-when
|
||||
- role-name
|
||||
# Related to code-style
|
||||
- no-jinja-nesting
|
||||
- no-tabs
|
||||
- playbook-extension
|
||||
- risky-octal
|
||||
- var-spacing
|
||||
- yaml
|
||||
# Possible indication that consequent runs would produce different results
|
||||
- git-latest
|
||||
- hg-latest
|
||||
- no-changed-when
|
||||
- package-latest
|
||||
# Anti-pattern detected, likely to cause undesired behavior
|
||||
- command-instead-of-module
|
||||
- command-instead-of-shell
|
||||
- empty-string-compare
|
||||
- inline-env-var
|
||||
- literal-compare
|
||||
- no-handler
|
||||
- no-loop-var-prefix
|
||||
- no-relative-paths
|
||||
- unnamed-task
|
||||
- var-naming
|
||||
# Invalid metadata, likely related to galaxy, collections or roles
|
||||
- meta-incorrect
|
||||
- meta-no-tags
|
||||
- meta-video-links
|
||||
- role-name
|
||||
- ignore-errors
|
||||
- partial-become
|
||||
- syntax-check
|
||||
# External linter which will also produce its own rule codes.
|
||||
- yaml
|
||||
|
||||
warn_list:
|
||||
- experimental # all rules tagged as experimental
|
||||
@ -71,5 +69,6 @@ warn_list:
|
||||
|
||||
skip_list:
|
||||
- role-name # BUG
|
||||
- name[casing]
|
||||
|
||||
verbosity: 1
|
||||
|
20
.github/workflows/molecule.yml
vendored
20
.github/workflows/molecule.yml
vendored
@ -38,11 +38,10 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "${{ github.repository }}"
|
||||
- name: molecule
|
||||
uses: robertdebock/molecule-action@4.0.9
|
||||
- name: Run ansible lint
|
||||
uses: ansible/ansible-lint-action@main
|
||||
with:
|
||||
command: lint
|
||||
scenario: ${{ fromJson(needs.setup.outputs.scenarios)[0] }}
|
||||
path: "."
|
||||
|
||||
test:
|
||||
name: Scenario "${{ matrix.scenario }}" on ${{ matrix.config.image }}:${{ matrix.config.tag }}
|
||||
@ -60,23 +59,26 @@ jobs:
|
||||
- name: "redhat"
|
||||
image: "registry.access.redhat.com/ubi8/ubi"
|
||||
tag: "latest"
|
||||
- image: "debian"
|
||||
tag: "12"
|
||||
- image: "debian"
|
||||
tag: "11"
|
||||
- image: "debian"
|
||||
tag: "10"
|
||||
- image: "ubuntu"
|
||||
tag: "22.04"
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "${{ github.repository }}"
|
||||
- name: molecule
|
||||
uses: robertdebock/molecule-action@4.0.9
|
||||
uses: gofrolist/molecule-action@v2
|
||||
with:
|
||||
# molecule_options: --debug
|
||||
molecule_command: test
|
||||
molecule_args: --scenario-name ${{ matrix.scenario }} -d docker
|
||||
molecule_working_dir: "${{ github.repository }}"
|
||||
env:
|
||||
image: ${{ matrix.config.image }}
|
||||
tag: ${{ matrix.config.tag }}
|
||||
scenario: ${{ matrix.scenario }}
|
||||
env:
|
||||
name: ${{ matrix.config.name }}
|
||||
|
@ -2,7 +2,7 @@
|
||||
[](https://www.claranet.fr/)
|
||||
[](LICENSE)
|
||||
[](https://github.com/claranet/ansible-role-motd/releases)
|
||||
[](https://github.com/claranet/ansible-role-motd/actions?query=workflow%3A%22Ansible+Molecule%22)
|
||||
[](https://github.com/claranet/ansible-role-motd/actions?query=workflow%3A%22Ansible+Molecule%22)
|
||||
[](https://github.com/ansible/ansible)
|
||||
[](https://galaxy.ansible.com/claranet/motd)
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
|
||||
pre_tasks:
|
||||
- name: "Update APT cache"
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
when:
|
||||
- ansible_pkg_mgr == "apt"
|
||||
|
||||
- name: Install sshd
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: openssh-server
|
||||
|
@ -1,13 +1,14 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
name: shell
|
||||
command: python3 -m pip install pytest-testinfra
|
||||
|
||||
driver:
|
||||
name: docker
|
||||
|
||||
platforms:
|
||||
# On "${name:-${image:-debian}", the last brace does not miss, it works like that...
|
||||
# The env var "name" should be used when the image variable refers to a full registry path like registry.access.redhat.com/ubi8/ubi
|
||||
# The env var should be used when the image variable refers to a full registry path like registry.access.redhat.com/ubi8/ubi
|
||||
- name: claranet_motd_${name:-${image:-debian}-${tag:-latest}-${scenario:-default}
|
||||
image: ${image:-debian}:${tag:-latest}
|
||||
privileged: true
|
||||
@ -31,8 +32,6 @@ provisioner:
|
||||
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
||||
options:
|
||||
verbose: true
|
||||
s: true
|
||||
|
@ -3,7 +3,7 @@
|
||||
ansible.builtin.include_tasks: disable_default_motd.yml
|
||||
when: motd_disable_default_motd|bool
|
||||
|
||||
- name: configure_motd | Apply template {{ motd_template }} on {{ _motd_file_path }}
|
||||
- name: "Configure_motd | Apply template {{ motd_template + ' in ' + _motd_file_path }}"
|
||||
ansible.builtin.copy:
|
||||
content: "{{ motd_template_prepend + _motd_template_content + motd_template_append }}"
|
||||
dest: "{{ _motd_file_path }}"
|
||||
@ -13,7 +13,7 @@
|
||||
tags:
|
||||
- molecule-idempotence-notest
|
||||
|
||||
- name: configure_motd | Add pam_exec {{ _motd_file_path }} in pam
|
||||
- name: Configure_motd | Add in pam pam_exec {{ _motd_file_path }}
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ item }}"
|
||||
line: session optional pam_exec.so type=open_session stdout {{ _motd_file_path }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user