This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
/
main.yml
101 lines (88 loc) · 3.01 KB
/
main.yml
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
97
98
99
100
101
---
- name: Load OS specific variables
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
- '{{ ansible_distribution }}.yml'
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml'
- '{{ ansible_os_family }}.yml'
paths:
- 'vars'
tags:
- always
- name: Ensure that if we have web cert, we also have key
fail:
msg: "If you give one of pulp_webserver_tls_cert and pulp_webserver_tls_key, you must also give the other."
when:
- "pulp_webserver_tls_cert is defined or pulp_webserver_tls_key is defined"
- "pulp_webserver_tls_cert is not defined or pulp_webserver_tls_key is not defined"
- debug:
msg: >
{{ (pulp_install_source == "packages") | ternary(pulp_python_interpreter, pulp_install_dir ~ "/bin/python") }}
verbosity: 1
- name: "Check installed plugins for {{ pulp_webserver_server }} snippets"
script:
cmd: check_snippet.py {{ item.key | regex_replace("-", "_") | quote }} {{ pulp_webserver_server }}.conf
args:
executable: '{{ (pulp_install_source == "packages") | ternary(pulp_python_interpreter, pulp_install_dir ~ "/bin/python") }}'
register: snippets
with_dict: '{{ pulp_install_plugins_normalized }}'
failed_when: >
snippets.stderr is search("env: 'python': No such file or directory")
changed_when: false
check_mode: false
- include_tasks: generate_tls_certificates.yml
args:
apply:
become: true
when:
- pulp_webserver_tls_cert is undefined
- pulp_webserver_tls_key is undefined
- include_tasks: import_certificates.yml
args:
apply:
become: true
when:
- pulp_webserver_tls_cert is defined
- pulp_webserver_tls_key is defined
- name: Copy custom CA cert
copy:
src: "{{ pulp_websserver_custom_ca_cert }}"
dest: "{{ pulp_webserver_trusted_root_certificates_path }}/pulp-custom-ca-cert.crt"
mode: '0644'
owner: root
group: root
when: pulp_websserver_custom_ca_cert is defined
become: true
notify: update ca trust
- name: Create ACME dirs
file:
path: "{{ item }}"
state: directory
mode: 0755
owner: "{{ pulp_user }}"
group: "{{ pulp_group }}"
become: true
with_items:
- "{{ pulp_webserver_static_dir }}"
- "{{ pulp_webserver_static_dir }}/.well-known"
- include_tasks: "{{ pulp_webserver_server }}.yml"
- block:
- name: Install packages for Ansible seboolean module
yum:
name: "{{ pulp_seboolean_packages }}"
state: present
- name: Set httpd_can_network_connect flag on and keep it persistent across reboots
seboolean:
name: httpd_can_network_connect
state: true
persistent: true
become: true
when:
- ansible_os_family == 'RedHat'
- ansible_selinux.status == 'enabled'
- not (pulp_api_bind.startswith('unix:') and pulp_content_bind.startswith('unix:'))
- include_tasks: firewalld.yml
when: pulp_configure_firewall in ['firewalld', 'auto']