forked from playingfield/clusterlust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost-initialization.yml
executable file
·53 lines (49 loc) · 1.22 KB
/
host-initialization.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
#!/usr/bin/env ansible-playbook
---
- name: Network config
hosts: controller
become: true
gather_facts: false
tags: [hostsfile]
tasks:
- name: Configure /etc/hosts
ansible.builtin.include_role:
name: clusterlust.hosts
- name: Network config
hosts: k8s_cluster
become: true
gather_facts: false
tags: [network]
tasks:
- name: Disable firewalld
ansible.builtin.systemd:
name: firewalld
state: stopped
enabled: false
- name: Disable AD DNS
ansible.builtin.lineinfile:
path: /etc/resolv.conf
regexp: 'nameserver 10.0.0.205'
line: 'nameserver 10.0.0.205'
state: absent
- name: Set hostname
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"
use: systemd
- name: Proxy config
hosts: k8s_cluster
become: true
gather_facts: false
tags: [proxy]
tasks:
- name: Fix dnf
ansible.builtin.lineinfile:
path: /etc/dnf/dnf.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
state: present
loop:
- regexp: '^proxy='
line: "proxy={{ http_proxy | default('') }}"
- regexp: '^repo_gpgcheck='
line: 'repo_gpgcheck=0'