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 ccf1071..7c50b71 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -4,4 +4,4 @@ become: true tasks: - name: include tasks - include: "{{ playbook_dir }}/../../tests/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/pre.yml" diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index edfe900..3f1ea7a 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -4,4 +4,4 @@ become: true tasks: - name: include tasks - include: "{{ playbook_dir }}/../../tests/tasks/post.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/post.yml" diff --git a/tasks/install.yml b/tasks/install.yml index fd41f9a..cd625ab 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,7 +1,7 @@ # tasks file --- - name: install | dependencies - apt: + ansible.builtin.apt: name: "{{ yarn_dependencies }}" state: "{{ apt_install_state | default('latest') }}" tags: diff --git a/tasks/main.yml b/tasks/main.yml index 8dbb4bb..202b50b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,12 +1,14 @@ # tasks file --- -- include: repository.yml +- name: repository + ansible.builtin.import_tasks: repository.yml tags: - configuration - yarn - yarn-repository -- include: install.yml +- name: install + ansible.builtin.import_tasks: install.yml tags: - configuration - yarn diff --git a/tasks/repository.yml b/tasks/repository.yml index 72af57a..9c101b0 100644 --- a/tasks/repository.yml +++ b/tasks/repository.yml @@ -1,7 +1,7 @@ # tasks file --- - name: repository | install dependencies (pre) - apt: + ansible.builtin.apt: name: "{{ yarn_dependencies_pre }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true @@ -10,7 +10,7 @@ - yarn-repository-install-dependencies - name: repository | add public key - apt_key: + ansible.builtin.apt_key: id: 1646B01B86E50310 url: https://dl.yarnpkg.com/debian/pubkey.gpg state: present @@ -18,7 +18,7 @@ - yarn-repository-public-key - name: repository | add - apt_repository: + ansible.builtin.apt_repository: repo: "{{ item.type }} {{ item.url }} {{ item.component }}" state: present update_cache: true diff --git a/tests/tasks/post.yml b/tests/tasks/post.yml index 6a105df..720f28e 100644 --- a/tests/tasks/post.yml +++ b/tests/tasks/post.yml @@ -1,6 +1,6 @@ # post test file --- - name: test installation - command: > + ansible.builtin.command: > yarn --version changed_when: false diff --git a/tests/tasks/pre.yml b/tests/tasks/pre.yml index a28259e..d38f05d 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: - software-properties-common - dirmngr @@ -12,7 +12,7 @@ cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" - name: setup nodejs # noqa command-instead-of-module - shell: > + ansible.builtin.shell: > curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - args: creates: /etc/apt/sources.list.d/nodesource.list @@ -20,7 +20,7 @@ - skip_ansible_lint - name: install nodejs - apt: + ansible.builtin.apt: name: - nodejs state: "{{ apt_install_state | default('latest') }}" diff --git a/tests/test.yml b/tests/test.yml index b148e17..9d93014 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,13 +5,13 @@ 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: - ../../ post_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/post.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/post.yml" diff --git a/tests/vagrant.yml b/tests/vagrant.yml index ef2b3d2..1592611 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -5,13 +5,13 @@ 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: - ../../ post_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/post.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/post.yml"