-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathaap_archive_service.yaml
More file actions
62 lines (57 loc) · 1.97 KB
/
aap_archive_service.yaml
File metadata and controls
62 lines (57 loc) · 1.97 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
---
- name: "Check if the repository tarball exists"
ansible.builtin.stat:
path: "{{ aap_archive_dest }}"
register: __aap_archive_tarball_exists
failed_when: false
changed_when: false
# If the repository tarball exists, you can force a refresh by setting aap_archive_refresh to true
- name: "Package AAP configuration repository and serve via HTTP"
block:
- name: "Create temporary directory"
ansible.builtin.file:
path: "{{ aap_archive_tmp_dir }}"
state: directory
mode: "0750"
- name: "Clone the configuration repository"
ansible.builtin.git:
repo: "{{ aap_config_repo }}"
dest: "{{ aap_archive_tmp_dir }}"
version: "{{ aap_config_version }}"
- name: "Create tarball of the repository"
ansible.builtin.archive:
path: "{{ aap_archive_tmp_dir }}"
dest: "{{ aap_archive_dest }}"
format: gz
ignore_errors: "{{ ansible_check_mode }}"
- name: "Set container recreate flag"
ansible.builtin.set_fact:
__aap_archive_container_recreate: true
always:
- name: "Remove temporary directory"
ansible.builtin.file:
path: "{{ aap_archive_tmp_dir }}"
state: absent
no_log: true
when: >
__aap_archive_tarball_exists.stat.exists is false or
__aap_archive_tarball_exists.stat.exists is not defined or
aap_archive_refresh | default(false) | bool
- name: "Run container to publish the AAP configuration"
containers.podman.podman_container:
name: "aap-archive-srv"
image: "{{ aap_archive_image }}"
authfile: "{{ aap_archive_authfile }}"
state: started
restart_policy: always
recreate: "{{ __aap_archive_container_recreate | default(false) | bool }}"
user: "1001"
command: "/usr/libexec/s2i/run"
security_opt:
- no-new-privileges
cap_drop:
- ALL
volumes:
- "{{ aap_archive_dest }}:/opt/app-root/src/aap-config-archive.tar.gz:Z"
publish:
- "{{ aap_archive_port }}:8080"