Skip to content

Commit

Permalink
Merge pull request #3 from Oefenweb/consistency-changes
Browse files Browse the repository at this point in the history
Consistency changes
  • Loading branch information
tersmitten authored Jun 5, 2023
2 parents f185cd3 + 13eb49f commit cd993ec
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 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
8 changes: 4 additions & 4 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# handlers file
---
- name: apply netplan config
command: >
- name: apply netplan config # noqa no-changed-when
ansible.builtin.command: >
netplan apply
listen: netplan apply config

- name: generate netplan config
command: >
- name: generate netplan config # noqa no-changed-when
ansible.builtin.command: >
netplan generate
listen: netplan generate config
notify: netplan apply config
17 changes: 8 additions & 9 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# tasks file
---
- block:

- name: configure
when: netplan_conf_purge | bool
tags:
- netplan-configure-purge
block:
- name: configure | find existing
find:
ansible.builtin.find:
paths: "{{ netplan_conf_path }}"
patterns: '*.yaml,*.yml'
register: _netplan_existing_files

- name: configure | remove existing
file:
ansible.builtin.file:
path: "{{ item['path'] }}"
state: absent
with_items: "{{ _netplan_existing_files['files'] }}"
when:
- item['path'] != netplan_conf_path + '/' + netplan_conf_file
notify: netplan generate config

when: netplan_conf_purge | bool
tags:
- netplan-configure-purge

- name: configure | update
template:
ansible.builtin.template:
src: etc/netplan/config.yaml.j2
dest: "{{ netplan_conf_path }}/{{ netplan_conf_file }}"
mode: 0644
Expand Down
4 changes: 2 additions & 2 deletions 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: "{{ netplan_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
Expand All @@ -10,7 +10,7 @@
- netplan-install-dependencies

- name: install | additional
apt:
ansible.builtin.apt:
name: "{{ netplan_install }}"
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
---
- import_tasks: install.yml
- name: install
ansible.builtin.import_tasks: install.yml
tags:
- configuration
- netplan
- netplan-install

- import_tasks: configure.yml
- name: configure
ansible.builtin.import_tasks: configure.yml
tags:
- configuration
- netplan
Expand Down

0 comments on commit cd993ec

Please sign in to comment.