feat: enable chrony-wait service (#2)
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #2
This commit is contained in:
Robert Kaussow 2023-06-05 22:04:10 +02:00
parent 5ab2044b9c
commit 8248d716b6
11 changed files with 45 additions and 14 deletions

View File

@ -41,7 +41,7 @@ local PipelineLinting = {
}, },
}; };
local PipelineDeployment(scenario='rocky8') = { local PipelineDeployment(scenario='rocky9') = {
kind: 'pipeline', kind: 'pipeline',
name: 'testing-' + scenario, name: 'testing-' + scenario,
platform: { platform: {
@ -71,7 +71,7 @@ local PipelineDeployment(scenario='rocky8') = {
'linting', 'linting',
], ],
trigger: { trigger: {
ref: ['refs/heads/main', 'refs/tags/**'], ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
}, },
}; };
@ -115,7 +115,7 @@ local PipelineDocumentation = {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
}, },
depends_on: [ depends_on: [
'testing-rocky8', 'testing-rocky9',
], ],
}; };
@ -153,7 +153,7 @@ local PipelineNotification = {
[ [
PipelineLinting, PipelineLinting,
PipelineDeployment(scenario='rocky8'), PipelineDeployment(scenario='rocky9'),
PipelineDocumentation, PipelineDocumentation,
PipelineNotification, PipelineNotification,
] ]

View File

@ -36,7 +36,7 @@ trigger:
--- ---
kind: pipeline kind: pipeline
name: testing-rocky8 name: testing-rocky9
platform: platform:
os: linux os: linux
@ -53,7 +53,7 @@ steps:
- name: ansible-molecule - name: ansible-molecule
image: thegeeklab/molecule:4 image: thegeeklab/molecule:4
commands: commands:
- molecule test -s rocky8 - molecule test -s rocky9
environment: environment:
HCLOUD_TOKEN: HCLOUD_TOKEN:
from_secret: hcloud_token from_secret: hcloud_token
@ -62,6 +62,7 @@ trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/**
depends_on: depends_on:
- linting - linting
@ -107,7 +108,7 @@ trigger:
- refs/pull/** - refs/pull/**
depends_on: depends_on:
- testing-rocky8 - testing-rocky9
--- ---
kind: pipeline kind: pipeline
@ -147,6 +148,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: 96908282833168a632002f8bf7c4be4f7577d84dad0016ca15e4232a64829650 hmac: b7a44b7df8263dae322f071146976aa945dda4857876c3b98475dd725a6f28c6
... ...

View File

@ -1 +1 @@
rocky8/ rocky9

View File

@ -9,8 +9,8 @@ dependency:
driver: driver:
name: delegated name: delegated
platforms: platforms:
- name: rocky8-chrony - name: rocky9-wireguard
image: rocky-8 image: rocky-9
server_type: cx11 server_type: cx11
lint: | lint: |
/usr/local/bin/flake8 /usr/local/bin/flake8

View File

@ -5,6 +5,17 @@
name: chrony name: chrony
state: present state: present
- name: Create required directories
loop:
- name: /etc/systemd/system/time-sync.target.d
mode: "0755"
loop_control:
label: "{{ item.name }}"
file:
path: "{{ item.name }}"
state: directory
mode: "{{ item.mode }}"
- name: Deploy configuration file - name: Deploy configuration file
template: template:
src: etc/chrony.conf.j2 src: etc/chrony.conf.j2
@ -23,11 +34,26 @@
mode: 0644 mode: 0644
notify: __chrony_restart notify: __chrony_restart
- name: Ensure service is up and running - name: Deploy time-sync.target override file
template:
src: etc/systemd/system/time-sync.target.d/requires.conf.j2
dest: /etc/systemd/system/time-sync.target.d/requires.conf
owner: root
group: root
mode: 0644
notify: __chrony_restart
- name: Ensure chronyd is up and running
systemd: systemd:
name: chronyd.service name: chronyd.service
state: started state: started
daemon_reload: True daemon_reload: True
enabled: True enabled: True
- name: Ensure chrony-wait is enabled
systemd:
name: chrony-wait.service
daemon_reload: True
enabled: True
become: True become: True
become_user: root become_user: root

View File

@ -0,0 +1,4 @@
#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
[Unit]
Requires=chrony-wait.service