diff --git a/.ansible-lint b/.ansible-lint index 7e0172a..b04781e 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,4 +1,5 @@ --- warn_list: - role-name + - name[play] - name[casing] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 292e437..7e2bc34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,9 @@ jobs: python-version: '3.x' - name: Install test dependencies - run: pip install ansible-lint[community,yamllint] + run: | + pip install ansible-lint + ansible-galaxy install -r requirements.yml - name: Lint code run: | @@ -43,11 +45,8 @@ jobs: matrix: include: - distro: debian8 - ansible-version: '<2.10' - distro: debian9 - distro: debian10 - - distro: ubuntu1604 - ansible-version: '>=2.9, <2.10' - distro: ubuntu1604 ansible-version: '>=2.10, <2.11' - distro: ubuntu1604 @@ -66,7 +65,7 @@ jobs: python-version: '3.x' - name: Install test dependencies - run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker + run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker - name: Run Molecule tests run: | diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 73043c4..8596f09 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -4,6 +4,6 @@ become: true pre_tasks: - name: include vars - include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml" roles: - ../../../ diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index bb63e11..4e9fc84 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -4,6 +4,6 @@ become: true tasks: - name: include vars - include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml" - name: include tasks - include: "{{ playbook_dir }}/../../tests/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/pre.yml" diff --git a/tasks/main.yml b/tasks/main.yml index cc0638e..192d43f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ # tasks file --- - name: include variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "_{{ ansible_distribution_release }}.yml" - "_{{ ansible_distribution | lower }}.yml" @@ -12,7 +12,7 @@ - sudoers-include-variables - name: install - apt: + ansible.builtin.apt: name: "{{ sudoers_dependencies }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true @@ -23,7 +23,7 @@ - sudoers-install - name: update /etc/sudoers.d directory permissions - file: + ansible.builtin.file: path: /etc/sudoers.d state: directory owner: root @@ -37,7 +37,7 @@ - sudoers-configuration-sudoers-d - name: update specific configuration files - template: + ansible.builtin.template: src: etc/sudoers.d/sudoers.j2 dest: "/etc/sudoers.d/{{ item.key }}" validate: "visudo -cf %s" @@ -52,7 +52,7 @@ - sudoers-configuration-sudoers-d - name: update global configuration file - template: + ansible.builtin.template: src: etc/sudoers.j2 dest: /etc/sudoers validate: "visudo -cf %s" diff --git a/tests/tasks/pre.yml b/tests/tasks/pre.yml index 0dd2a59..038d29f 100644 --- a/tests/tasks/pre.yml +++ b/tests/tasks/pre.yml @@ -1,5 +1,5 @@ # pre test file --- - name: create user (if needed) - user: + ansible.builtin.user: name: dummy diff --git a/tests/test.yml b/tests/test.yml index d3837dc..69b9404 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,8 +5,8 @@ become: true pre_tasks: - name: include vars - include_vars: "{{ playbook_dir }}/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" - name: include tasks - include: "{{ playbook_dir }}/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml" roles: - ../../ diff --git a/tests/vagrant.yml b/tests/vagrant.yml index dce3560..0dff732 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -5,8 +5,8 @@ become: true pre_tasks: - name: include vars - include_vars: "{{ playbook_dir }}/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" - name: include tasks - include: "{{ playbook_dir }}/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml" roles: - ../../