Skip to content

Commit

Permalink
Merge pull request #10 from rolehippie/fqcn-and-linting
Browse files Browse the repository at this point in the history
Use fully qualified collection names (FQCN) and fix linting for latest ansible-later version and drop Ubuntu 18.04
  • Loading branch information
tboerger authored Feb 6, 2024
2 parents 5cf6f63 + c595122 commit 9f2a8d6
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 75 deletions.
4 changes: 4 additions & 0 deletions .later.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ rules:
- molecule/ubuntu/tests
- README.md

yamllint:
document-end:
present: True

...
1 change: 0 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
# @var ipsec_charon_debug:description: Debugging levels for charon
ipsec_charon_debug: ike 1, knl 1, cfg 0
Expand Down
92 changes: 55 additions & 37 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Standards: 1.2
---
- name: Reload strongswan
systemd:
ansible.builtin.systemd:
name: "{{ ipsec_service_name }}"
state: reloaded
daemon_reload: True
Expand Down
2 changes: 0 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
# @meta author:value: [Thomas Boerger](https://github.com/tboerger)
# @meta description: >
Expand Down Expand Up @@ -28,7 +27,6 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- bionic
- focal
- jammy
galaxy_tags:
Expand Down
1 change: 0 additions & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
- name: Converge
hosts: all
Expand Down
16 changes: 0 additions & 16 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
dependency:
name: galaxy
Expand Down Expand Up @@ -41,21 +40,6 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
environment:
container: docker
- name: ipsec-ubuntu-18
image: docker.io/geerlingguy/docker-ubuntu1804-ansible:latest
hostname: ubuntu
privileged: True
pre_build_image: True
override_command: False
cgroupns_mode: host
tmpfs:
- /tmp
- /run
- /run/lock
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
environment:
container: docker

provisioner:
name: ansible
Expand Down
42 changes: 36 additions & 6 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
# Standards: 1.2
---
- name: Prepare
hosts: all
gather_facts: False

tasks:
- name: Stat apt dir
register: aptdir
ansible.builtin.stat:
path: /var/lib/apt

- name: Wait for aptlock
shell: while fuser /var/lib/apt/lists/lock >/dev/null 2>&1; do echo 'Waiting for apt list lock.' && sleep 10; done
when: aptdir.stat.exists
changed_when: False
ansible.builtin.shell:
cmd: while fuser /var/lib/apt/lists/lock >/dev/null 2>&1; do echo 'Waiting for apt list lock.' && sleep 10; done

- name: Update package cache
apt:
when: aptdir.stat.exists
ansible.builtin.apt:
update_cache: True

- name: Install gpg dependency
apt:
name: python3-gpg
- name: Install test dependencies
when: aptdir.stat.exists
loop:
- python3-gpg
- curl
ansible.builtin.apt:
name: "{{ item }}"
state: present

- name: Create man dirs
changed_when: False
loop:
- /usr/share/man/man1
- /usr/share/man/man2
- /usr/share/man/man3
- /usr/share/man/man4
- /usr/share/man/man5
- /usr/share/man/man6
- /usr/share/man/man7
- /usr/share/man/man8
- /usr/share/man/man9
ansible.builtin.file:
path: "{{ item }}"
owner: root
group: root
mode: u=rwx,g=rx,o=rx
state: directory

...
1 change: 0 additions & 1 deletion molecule/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
collections: []
roles: []
Expand Down
11 changes: 5 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Standards: 1.2
---
- name: Include OS vars
include_vars: "{{ item }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution | lower }}.yml"
Expand All @@ -18,7 +17,7 @@
- libstrongswan-extra-plugins
- libstrongswan-standard-plugins
- libcharon-extra-plugins
package:
ansible.builtin.package:
name: "{{ item }}"
state: present
tags:
Expand All @@ -27,7 +26,7 @@
- name: Write secrets config
notify:
- Reload strongswan
template:
ansible.builtin.template:
src: secrets.j2
dest: /etc/ipsec.secrets
owner: root
Expand All @@ -39,7 +38,7 @@
- name: Write ipsec config
notify:
- Reload strongswan
template:
ansible.builtin.template:
src: config.j2
dest: /etc/ipsec.conf
owner: root
Expand All @@ -49,7 +48,7 @@
- ipsec

- name: Start strongswan service
systemd:
ansible.builtin.systemd:
name: "{{ ipsec_service_name }}"
state: started
daemon_reload: True
Expand Down
1 change: 0 additions & 1 deletion vars/ubuntu-18.04.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
ipsec_service_name: strongswan

Expand Down
1 change: 0 additions & 1 deletion vars/ubuntu-20.04.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
ipsec_service_name: strongswan-starter

Expand Down
1 change: 0 additions & 1 deletion vars/ubuntu-22.04.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Standards: 1.2
---
ipsec_service_name: strongswan-starter

Expand Down

0 comments on commit 9f2a8d6

Please sign in to comment.