forked from theforeman/foremanctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.yml
More file actions
96 lines (86 loc) · 3.41 KB
/
main.yml
File metadata and controls
96 lines (86 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
- name: Create log directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: '0755'
loop:
- /var/log/candlepin
- /var/log/tomcat
- name: Configure certificates
ansible.builtin.include_tasks:
file: certs.yml
- name: Create Candlepin configuration
containers.podman.podman_secret:
state: present
name: candlepin-candlepin-conf
data: "{{ lookup('ansible.builtin.template', 'candlepin.conf.j2') }}"
labels:
filename: candlepin.conf
app: candlepin
- name: Create Tomcat server.xml
containers.podman.podman_secret:
state: present
name: candlepin-tomcat-server-xml
data: "{{ lookup('ansible.builtin.template', 'server.xml.j2') }}"
labels:
filename: server.xml
app: tomcat
- name: Create Tomcat server configuration
containers.podman.podman_secret:
state: present
name: candlepin-tomcat-conf
data: "{{ lookup('ansible.builtin.template', 'tomcat.conf') }}"
labels:
filename: tomcat.conf
app: tomcat
- name: Setup artemis
ansible.builtin.include_tasks:
file: artemis.yml
- name: Pull the Candlepin container image
containers.podman.podman_image:
name: "{{ candlepin_container_image }}:{{ candlepin_container_tag }}"
state: present
- name: Deploy Candlepin quadlet
containers.podman.podman_container:
name: "candlepin"
image: "{{ candlepin_container_image }}:{{ candlepin_container_tag }}"
state: quadlet
network: host
hostname: "{{ ansible_fqdn }}"
expose:
- 23443
- 61613
secrets:
- "candlepin-ca-cert,target=/etc/candlepin/certs/candlepin-ca.crt,mode=0440,type=mount,uid=10001,gid=10000"
- "candlepin-ca-key,target=/etc/candlepin/certs/candlepin-ca.key,mode=0440,type=mount,uid=10001,gid=10000"
- "candlepin-tomcat-keystore,target=/etc/candlepin/certs/keystore,mode=0440,type=mount,uid=10001,gid=10000"
- "candlepin-tomcat-truststore,target=/etc/candlepin/certs/truststore,mode=0440,type=mount,uid=10001,gid=10000"
- "candlepin-candlepin-conf,target=/etc/candlepin/candlepin.conf,mode=0440,type=mount,uid=10001,gid=10000"
- "candlepin-artemis-broker-xml,target=/etc/candlepin/broker.xml,mode=440,type=mount,uid=10001,gid=10000"
- "candlepin-tomcat-server-xml,target={{ candlepin_tomcat_home }}/conf/server.xml,mode=440,type=mount,uid=10001,gid=10000"
- "candlepin-artemis-login-config,target={{ candlepin_tomcat_home }}/conf/login.config,mode=440,type=mount,uid=10001,gid=10000"
- "candlepin-artemis-cert-roles-properties,target={{ candlepin_tomcat_home }}/conf/cert-roles.properties,mode=440,type=mount,uid=10001,gid=10000"
- "candlepin-artemis-cert-users-properties,target={{ candlepin_tomcat_home }}/conf/cert-users.properties,mode=440,type=mount,uid=10001,gid=10000"
- "candlepin-artemis-catalina-opts,type=env,target=CATALINA_OPTS"
quadlet_options:
- |
[Install]
WantedBy=default.target
- name: Run daemon reload to make Quadlet create the service files
ansible.builtin.systemd:
daemon_reload: true
- name: Start the Quadlet Demo Service
ansible.builtin.systemd:
name: candlepin
state: restarted
- name: Wait for Candlepin service to be accessible
ansible.builtin.uri:
url: 'https://localhost:23443/candlepin/status'
validate_certs: false
until: candlepin_status.status == 200
retries: 60
delay: 5
register: candlepin_status