Skip to content

Commit 2f2b33a

Browse files
authored
Merge pull request #8 from EthDevOps/lint-fixes
chore: linting
2 parents a9bce79 + 2587c4a commit 2f2b33a

9 files changed

Lines changed: 14 additions & 58 deletions

File tree

roles/acme_certificates/tasks/main.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,29 @@
66
pkg:
77
- certbot
88
- python3-certbot-dns-cloudflare
9-
109
- name: Install snapd
1110
ansible.builtin.apt:
1211
pkg:
1312
- snapd
14-
1513
- name: Enable and start snapd socket
1614
ansible.builtin.systemd:
1715
name: snapd.socket
1816
enabled: true
1917
state: started
20-
2118
- name: Install snap core
2219
community.general.snap:
2320
name: core
2421
state: present
25-
2622
- name: Install certbot via snap
2723
community.general.snap:
2824
name: certbot
2925
classic: true
3026
state: present
31-
3227
- name: Create certbot symlink
3328
ansible.builtin.file:
3429
src: /snap/bin/certbot
3530
dest: /usr/bin/certbot
3631
state: link
37-
3832
- name: Download acme-dns-hook
3933
ansible.builtin.get_url:
4034
url: >-
@@ -67,9 +61,11 @@
6761
when: item.stat.exists
6862
ansible.builtin.shell:
6963
cmd: |
64+
set -o pipefail
7065
start=$(openssl x509 -startdate -noout -in /etc/letsencrypt/live/{{ item.item.domain }}/cert.pem | cut -d= -f2)
7166
end=$(openssl x509 -enddate -noout -in /etc/letsencrypt/live/{{ item.item.domain }}/cert.pem | cut -d= -f2)
7267
echo $(( ($(date -d "$end" +%s) - $(date -d "$start" +%s)) / 86400 ))
68+
executable: /bin/bash
7369
loop: "{{ acme_certificates_cert_status.results }}"
7470
loop_control:
7571
label: "{{ item.item.domain }}"

roles/bootstrap/tasks/deploy_patchman.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
url: https://repo.openbytes.ie/openbytes.gpg
99
dest: /etc/apt/keyrings/openbytes.gpg
1010
- name: Remove old openbytes repo configuration
11-
file:
11+
ansible.builtin.file:
1212
path: /etc/apt/sources.list.d/repo_openbytes_ie_patchman_debian.list
1313
state: absent
1414
- name: Add openbytes repo

roles/bootstrap/tasks/disable_auto_updates.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,22 @@
44
name: apt-daily.timer
55
state: stopped
66
enabled: false
7-
87
- name: Stop and disable apt-daily-upgrade timer
98
ansible.builtin.systemd_service:
109
name: apt-daily-upgrade.timer
1110
state: stopped
1211
enabled: false
13-
1412
- name: Stop and disable unattended-upgrades service
1513
ansible.builtin.systemd_service:
1614
name: unattended-upgrades.service
1715
state: stopped
1816
enabled: false
19-
2017
- name: Stop and disable update-notifier-download timer
2118
ansible.builtin.systemd_service:
2219
name: update-notifier-download.timer
2320
state: stopped
2421
enabled: false
2522
failed_when: false
26-
2723
- name: Disable automatic package list updates and unattended upgrades
2824
ansible.builtin.copy:
2925
dest: /etc/apt/apt.conf.d/20auto-upgrades

roles/haproxy_lb/defaults/main.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ haproxy_lb_sites: []
1111
haproxy_lb_tunnels: []
1212
haproxy_lb_redirects: []
1313
haproxy_lb_k8s_services: []
14-
1514
# Custom backend configuration snippets for HAProxy backends
1615
# Keyed by backend name, value is raw HAProxy config to inject
1716
# Supported backend types and their keys:

roles/k3s/tasks/cache.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Create cache config directory
3-
file:
3+
ansible.builtin.file:
44
state: directory
55
path: /etc/rancher/k3s
66
mode: '0755'

roles/openbao_agent/defaults/main.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
---
22
# OpenBao version to install
33
openbao_agent_version: "2.4.4"
4-
54
# OpenBao server address
65
openbao_agent_server_addr: "https://vault.example.com:8200"
7-
86
# AppRole auth mount path
97
openbao_agent_approle_mount_path: "approle"
10-
118
# Role name pattern uses inventory_hostname
129
# The actual role name will be: host-{{ inventory_hostname }}
13-
1410
# Wrap TTL for secret-id (how long the wrapped token is valid)
1511
openbao_agent_wrap_ttl: "120s"
16-
1712
# Agent configuration
1813
openbao_agent_cache_enabled: false
1914
openbao_agent_listener_address: "127.0.0.1:8100"
20-
2115
# Auto-auth sink file path (where the agent writes the token)
2216
openbao_agent_sink_path: "/run/openbao-agent/token"
23-
2417
# Template destinations (optional list of templates the agent should render)
2518
# Example:
2619
# openbao_agent_templates:

roles/openbao_agent/tasks/main.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,40 @@
55
- gpg
66
state: present
77
update_cache: true
8-
98
- name: Set architecture mapping
109
ansible.builtin.set_fact:
11-
openbao_arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else 'arm64' if ansible_architecture == 'aarch64' else ansible_architecture }}"
12-
10+
openbao_agent_arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else 'arm64' if ansible_architecture == 'aarch64' else ansible_architecture }}"
1311
- name: Download OpenBao GPG key
1412
ansible.builtin.get_url:
1513
url: https://openbao.org/assets/openbao-gpg-pub-20240618.asc
1614
dest: /tmp/openbao-gpg-pub.asc
1715
mode: "0644"
18-
1916
- name: Import OpenBao GPG key
2017
ansible.builtin.command:
2118
cmd: gpg --import /tmp/openbao-gpg-pub.asc
22-
register: gpg_import_result
23-
changed_when: "'imported' in gpg_import_result.stderr"
24-
19+
register: openbao_agent_gpg_import_result
20+
changed_when: "'imported' in openbao_agent_gpg_import_result.stderr"
2521
- name: Download OpenBao deb package
2622
ansible.builtin.get_url:
27-
url: "https://github.com/openbao/openbao/releases/download/v{{ openbao_agent_version }}/bao_{{ openbao_agent_version }}_linux_{{ openbao_arch }}.deb"
28-
dest: "/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_arch }}.deb"
23+
url: "https://github.com/openbao/openbao/releases/download/v{{ openbao_agent_version }}/bao_{{ openbao_agent_version }}_linux_{{ openbao_agent_arch }}.deb"
24+
dest: "/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_agent_arch }}.deb"
2925
mode: "0644"
30-
3126
- name: Download OpenBao deb signature
3227
ansible.builtin.get_url:
33-
url: "https://github.com/openbao/openbao/releases/download/v{{ openbao_agent_version }}/bao_{{ openbao_agent_version }}_linux_{{ openbao_arch }}.deb.gpgsig"
34-
dest: "/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_arch }}.deb.gpgsig"
28+
url: "https://github.com/openbao/openbao/releases/download/v{{ openbao_agent_version }}/bao_{{ openbao_agent_version }}_linux_{{ openbao_agent_arch }}.deb.gpgsig"
29+
dest: "/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_agent_arch }}.deb.gpgsig"
3530
mode: "0644"
36-
3731
- name: Verify GPG signature of OpenBao deb package
3832
ansible.builtin.command:
3933
cmd: >
4034
gpg --verify
41-
/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_arch }}.deb.gpgsig
42-
/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_arch }}.deb
35+
/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_agent_arch }}.deb.gpgsig
36+
/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_agent_arch }}.deb
4337
changed_when: false
44-
4538
- name: Install OpenBao from deb package
4639
ansible.builtin.apt:
47-
deb: "/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_arch }}.deb"
40+
deb: "/tmp/bao_{{ openbao_agent_version }}_linux_{{ openbao_agent_arch }}.deb"
4841
state: present
49-
5042
- name: Create openbao-agent directories
5143
ansible.builtin.file:
5244
path: "{{ item }}"
@@ -59,19 +51,16 @@
5951
- /etc/openbao-agent/conf.d
6052
- /etc/openbao-agent/templates.d
6153
- /var/lib/openbao-agent
62-
6354
- name: Create runtime directory for agent token
6455
ansible.builtin.file:
6556
path: /run/openbao-agent
6657
state: directory
6758
owner: openbao
6859
group: openbao
6960
mode: "0750"
70-
7161
- name: Set OpenBao role name fact
7262
ansible.builtin.set_fact:
7363
openbao_agent_role_name: "host-{{ inventory_hostname }}"
74-
7564
- name: Fetch role-id from OpenBao on control node
7665
ansible.builtin.command:
7766
cmd: >
@@ -81,11 +70,9 @@
8170
become: false
8271
register: openbao_agent_role_id_result
8372
changed_when: false
84-
8573
- name: Set role-id fact
8674
ansible.builtin.set_fact:
8775
openbao_agent_role_id: "{{ openbao_agent_role_id_result.stdout }}"
88-
8976
- name: Fetch secret-id from OpenBao on control node
9077
ansible.builtin.command:
9178
cmd: >
@@ -95,27 +82,23 @@
9582
become: false
9683
register: openbao_agent_secret_id_result
9784
changed_when: false
98-
9985
- name: Set secret-id fact
10086
ansible.builtin.set_fact:
10187
openbao_agent_secret_id: "{{ openbao_agent_secret_id_result.stdout }}"
102-
10388
- name: Deploy role-id file
10489
ansible.builtin.copy:
10590
content: "{{ openbao_agent_role_id }}"
10691
dest: /etc/openbao-agent/role-id
10792
owner: openbao
10893
group: openbao
10994
mode: "0400"
110-
11195
- name: Deploy wrapped secret-id file
11296
ansible.builtin.copy:
11397
content: "{{ openbao_agent_secret_id }}"
11498
dest: /etc/openbao-agent/secret-id
11599
owner: openbao
116100
group: openbao
117101
mode: "0400"
118-
119102
- name: Deploy OpenBao agent configuration
120103
notify: Restart openbao-agent
121104
ansible.builtin.template:
@@ -124,7 +107,6 @@
124107
owner: openbao
125108
group: openbao
126109
mode: "0640"
127-
128110
- name: Deploy systemd service file
129111
notify: Restart openbao-agent
130112
ansible.builtin.template:
@@ -133,11 +115,9 @@
133115
owner: root
134116
group: root
135117
mode: "0644"
136-
137118
- name: Reload systemd daemon
138119
ansible.builtin.systemd:
139120
daemon_reload: true
140-
141121
- name: Enable and start OpenBao agent
142122
ansible.builtin.systemd:
143123
name: openbao-agent

roles/vector/defaults/main.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ vector_extra_metrics: ""
33
vector_install_nodexporter: true
44
vector_version: "0.51.1-1"
55
vector_use_openbao: false
6-
76
# OpenBao/Vault secret configuration
87
vector_vault_secret_path: "secret/common/metric_ingress"
98
vector_vault_user_field: "metrics_username"

roles/vector/tasks/main.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,17 @@
4848
groups: docker
4949
append: true
5050
when: vector_docker_group_check.rc == 0
51-
5251
- name: Create config file (direct)
5352
when: not vector_use_openbao
5453
ansible.builtin.template:
5554
src: vector.yaml.j2
5655
dest: /etc/vector/vector.yaml
5756
notify: Restart Vector
58-
5957
- name: Ensure ACL package is installed
6058
when: vector_use_openbao
6159
ansible.builtin.package:
6260
name: acl
6361
state: present
64-
6562
- name: Ensure vector config file exists for ACL
6663
when: vector_use_openbao
6764
ansible.builtin.file:
@@ -72,7 +69,6 @@
7269
mode: '0644'
7370
modification_time: preserve
7471
access_time: preserve
75-
7672
- name: Set ACL for openbao on vector dir
7773
when: vector_use_openbao
7874
ansible.posix.acl:
@@ -81,7 +77,6 @@
8177
etype: user
8278
permissions: rwx
8379
state: present
84-
8580
- name: Set ACL for openbao on vector config
8681
when: vector_use_openbao
8782
ansible.posix.acl:
@@ -90,13 +85,11 @@
9085
etype: user
9186
permissions: rw
9287
state: present
93-
9488
- name: Create config file (openbao)
9589
when: vector_use_openbao
9690
ansible.builtin.template:
9791
src: vector.yaml.tpl
9892
dest: /etc/openbao-agent/templates.d/vector.yaml.tpl
99-
10093
- name: Copy OpenBao template config file
10194
when: vector_use_openbao
10295
ansible.builtin.copy:

0 commit comments

Comments
 (0)