-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcontainer-nodes.yml
40 lines (38 loc) · 1.18 KB
/
container-nodes.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
---
- name: Containers
hosts: hypervisors
gather_facts: false
pre_tasks:
- setup:
gather_subset: min
roles:
- container_nodes
# Python not present on Ubuntu and used by Ansible
- name: Wait for Python 2 to be installed
hosts: created_nodes
gather_facts: false
become: true
tasks:
# - raw: echo "nameserver {{ host_ip }}" > /etc/resolv.conf
- raw: test -e /usr/bin/python || (apt -y update && apt install -y python3-minimal)
when:
- method == "create"
- ansible_distribution == "ubuntu"
# - name: Populate /etc/resolv.conf file
# hosts: created_nodes
# gather_facts: false
# become: true
# tasks:
# - name: Set {{ host_ip }} as nameserver in resolv.conf
# lineinfile:
# path: "/etc/resolv.conf"
# regexp: '^nameserver .*'
# line: 'nameserver {{ host_ip }}'
# when: method == "create"
# - name: Set search domain in resolv.conf
# lineinfile:
# path: "/etc/resolv.conf"
# regexp: '^search .*'
# #Fix using {{ dns_domain }} from virtual-nodes playbook
# line: 'search mydomain.org'
# when: method == "create" and not ansible_distribution|lower == "fedora"