This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
/
main.yml
87 lines (78 loc) · 2.8 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
---
- debug:
var: pulp_install_plugins
verbosity: 1
- debug:
var: pulp_install_plugins_normalized_yml
verbosity: 1
- debug:
var: pulp_install_plugins_normalized
verbosity: 1
- name: Check if required variables are set
assert:
that:
# This check runs it through jinja2 templating twice: built-in
# "that:" (like when:), and then the {{ }}
# It converts from item, to the string like pulp_default_admin_password ,
# to the value of pulp_default_admin_password .
- "{{ item }} | default('', true) | length > 0"
fail_msg: >
{{ item }} is undefined, null, an empty string, or an empty dictionary "{}" . Please
set it in your variables
(e.g. pulp_installer/playbooks/example-use/group_vars/all)
and run pulp_installer again.
See https://pulp-installer.readthedocs.io/en/latest/ or
pulp_installer/roles/pulp/README.md for more info.
loop:
- pulp_settings.content_origin
- pulp_settings.secret_key
- pulp_install_plugins
- 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: Is this a supported version of CentOS
fail:
msg: Pulp Installer only supports CentOS 7.7 or higher.
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_version|float < 7.7
# Note: We cannot use `systemd-path search-binaries-default` because
# it wasn't added until systemd 239. Thus no CentOS 7 or Fedora 28
# support, etc.
- name: Enumerate default system PATH
# pipefail is not needed due to grep's rc, but it resolves ansible-lint 306
shell: |
set -o pipefail
systemctl show-environment | grep -E '^PATH=' | sed 's/PATH=//g'
args:
# Debian defaults to bourne, but it doesn't understand pipefail.
executable: /bin/bash
changed_when: false
register: systemd_show_env_path
check_mode: false
- name: set the default system PATH as a fact
set_fact:
default_bin_path: "{{ systemd_show_env_path.stdout }}"
- import_tasks: repos.yml
- import_tasks: install.yml
# This task is after install.yml since it gets installed then.
- name: Find and use the first found possible path to django-admin
include_tasks: find_django_admin.yml
with_items: "{{ pulp_django_admin_paths }}"
when:
# Works for both strings and lists to make sure not empty
- pulp_django_admin_paths is not none
- pulp_django_admin_paths | length > 0
# Prevents running again once completed.
- pulp_django_admin_path is not defined
- import_tasks: configure.yml