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 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 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/tasks/groups-post.yml b/tasks/groups-post.yml index be9f68a..7078e05 100644 --- a/tasks/groups-post.yml +++ b/tasks/groups-post.yml @@ -1,7 +1,7 @@ # tasks file --- - name: groups | delete (user) - group: + ansible.builtin.group: name: "{{ item.group | default(item.name) }}" state: absent with_items: "{{ user_users }}" diff --git a/tasks/groups-pre.yml b/tasks/groups-pre.yml index 6a1c52a..55be18c 100644 --- a/tasks/groups-pre.yml +++ b/tasks/groups-pre.yml @@ -1,7 +1,7 @@ # tasks file --- - name: groups | add / delete - group: + ansible.builtin.group: name: "{{ item.name }}" system: "{{ item.system | default(false) }}" gid: "{{ item.gid | default(omit) }}" @@ -11,7 +11,7 @@ - user-groups-gid - name: groups | add (user) - group: + ansible.builtin.group: name: "{{ item.group | default(item.name) }}" state: present with_items: "{{ user_users }}" diff --git a/tasks/main.yml b/tasks/main.yml index 95ddffc..c47d48c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,19 +1,22 @@ # tasks file --- -- include: groups-pre.yml +- name: groups pre + ansible.builtin.import_tasks: groups-pre.yml tags: - configuration - user - user-groups - user-groups-pre -- include: users.yml +- name: users + ansible.builtin.import_tasks: users.yml tags: - configuration - user - user-users -- include: groups-post.yml +- name: groups post + ansible.builtin.import_tasks: groups-post.yml tags: - configuration - user diff --git a/tasks/users.yml b/tasks/users.yml index a71706c..7ac6b63 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -1,7 +1,7 @@ # tasks file --- - name: users | add / delete - user: + ansible.builtin.user: name: "{{ item.name }}" uid: "{{ item.uid | default(omit) }}" comment: "{{ item.comment | default('') }}" @@ -21,7 +21,7 @@ - user-users-gid - name: users | permissions - file: + ansible.builtin.file: path: "{{ item.home | default(('/' if item.name == 'root' else '/home/') + item.name) }}" mode: "{{ item.dir_mode }}" state: directory diff --git a/tests/test.yml b/tests/test.yml index c2fbb9f..8d7cd5f 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,6 +5,6 @@ become: true pre_tasks: - name: include vars - include_vars: "{{ playbook_dir }}/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" roles: - ../../ diff --git a/tests/vagrant.yml b/tests/vagrant.yml index 3808922..851ce22 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -5,6 +5,6 @@ become: true pre_tasks: - name: include vars - include_vars: "{{ playbook_dir }}/vars/main.yml" + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" roles: - ../../