-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.yml
30 lines (26 loc) · 989 Bytes
/
init.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
- name: Pre Run Adjustments
hosts: undercloud
tags: init
gather_facts: no
become: yes
any_errors_fatal: true
tasks:
- name: Set selinux state
selinux:
policy: "targeted"
state: "{{ install.selinux|default('enforcing') }}"
- name: Ensure yum presence
# ... helps with old/middle-aged fedora, possibly not needed
shell: python -c 'import yum' || (dnf install -y yum yum-utils && ln -snf /usr/bin/yum-deprecated /usr/bin/yum)
when: ansible_distribution == "Fedora"
- name: set hostname
hostname:
# todo(yfried): this seems highly specific. Refactor this to a more generic use case
name: "{{ inventory_hostname }}.redhat.local"
- name: update /etc/hosts with undercloud details
lineinfile:
dest: "/etc/hosts"
line: "127.0.0.1 {{ inventory_hostname }}.redhat.local {{ inventory_hostname }}"
state: present
- import_playbook: create_user.yml
tags: user