Skip to content

Commit

Permalink
Consistency changes (#12)
Browse files Browse the repository at this point in the history
* WIP

* WIP
  • Loading branch information
tersmitten authored Aug 31, 2023
1 parent 66a632a commit fcea2d0
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 26 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
warn_list:
- role-name
- name[play]
- name[casing]
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- ../../../
2 changes: 1 addition & 1 deletion molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tasks file
---
- name: install | dependencies
apt:
ansible.builtin.apt:
name: "{{ yarn_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
tags:
Expand Down
6 changes: 4 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions tasks/repository.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,15 +10,15 @@
- 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
tags:
- 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
Expand Down
2 changes: 1 addition & 1 deletion tests/tasks/post.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# post test file
---
- name: test installation
command: >
ansible.builtin.command: >
yarn --version
changed_when: false
6 changes: 3 additions & 3 deletions tests/tasks/pre.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pre test file
---
- name: install dependencies
apt:
ansible.builtin.apt:
name:
- software-properties-common
- dirmngr
Expand All @@ -12,15 +12,15 @@
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
tags:
- skip_ansible_lint

- name: install nodejs
apt:
ansible.builtin.apt:
name:
- nodejs
state: "{{ apt_install_state | default('latest') }}"
8 changes: 4 additions & 4 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 4 additions & 4 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit fcea2d0

Please sign in to comment.