diff --git a/.ansible-lint b/.ansible-lint index 2a5008c..b04781e 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,6 +1,5 @@ --- warn_list: - role-name + - name[play] - name[casing] - - '204' - - '403' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7d526c..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,14 +65,14 @@ 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: | molecule test env: ANSIBLE_FORCE_COLOR: '1' - ANSIBLE_VERBOSITY: '3' + ANSIBLE_VERBOSITY: '2' MOLECULE_DEBUG: '1' MOLECULE_DISTRO: "${{ matrix.distro }}" PY_COLORS: '1' diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 44670e5..8cf3207 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -4,7 +4,7 @@ become: true pre_tasks: - name: include variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution_release }}.yml" - "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution | lower }}.yml" diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index db1ccc8..878bcc7 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -4,10 +4,10 @@ become: true pre_tasks: - name: include variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution_release }}.yml" - "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution | lower }}.yml" - "{{ playbook_dir }}/../../tests/vars/_default.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 5f4c8a9..ada12fa 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ # tasks file --- - name: install dependencies - apt: + ansible.builtin.apt: name: "{{ virtualenv_dependencies }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true @@ -12,8 +12,8 @@ - virtualenv-install - virtualenv-install-dependencies -- name: install - pip: +- name: install # noqa package-latest + ansible.builtin.pip: name: "{{ virtualenv_pip_dependencies }}" state: latest executable: "pip{{ virtualenv_python_version_major | string }}" diff --git a/tests/tasks/pre.yml b/tests/tasks/pre.yml index e3f6f1d..75d671d 100644 --- a/tests/tasks/pre.yml +++ b/tests/tasks/pre.yml @@ -1,7 +1,7 @@ # pre test file --- - name: install dependencies - apt: + ansible.builtin.apt: name: - "python{{ virtualenv_python_version_major is version('3', '>=') | ternary('3', '') }}" - curl @@ -10,7 +10,7 @@ cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" - name: install pip # noqa command-instead-of-module - shell: > + ansible.builtin.shell: > curl -sL {{ virtualenv_get_pip_url }} | python{{ virtualenv_python_version_major | string }} - changed_when: false tags: diff --git a/tests/test.yml b/tests/test.yml index 4eb8b22..e978481 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,13 +5,13 @@ become: true pre_tasks: - name: include variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ playbook_dir }}/vars/_{{ ansible_distribution_release }}.yml" - "{{ playbook_dir }}/vars/_{{ ansible_distribution | lower }}.yml" - "{{ playbook_dir }}/vars/_default.yml" - name: include tasks - include: "{{ playbook_dir }}/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml" roles: - ../../ # vars: diff --git a/tests/vagrant.yml b/tests/vagrant.yml index 9acfb30..28301e7 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -5,12 +5,12 @@ become: true pre_tasks: - name: include variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ playbook_dir }}/vars/_{{ ansible_distribution_release }}.yml" - "{{ playbook_dir }}/vars/_{{ ansible_distribution | lower }}.yml" - "{{ playbook_dir }}/vars/_default.yml" - name: include tasks - include: "{{ playbook_dir }}/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml" roles: - ../../