Version initial du 2020/09/10
This commit is contained in:
33
configure-host-oel7/tasks/network_configuration.yml
Executable file
33
configure-host-oel7/tasks/network_configuration.yml
Executable file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
# ---------------------------------------------------
|
||||
# configuration réseau
|
||||
# ---------------------------------------------------
|
||||
|
||||
- name: Vérification de l enregistrement DNS
|
||||
command: nslookup {{ ansible_hostname }}
|
||||
register: ns
|
||||
ignore_errors: True
|
||||
tags: etchosts
|
||||
|
||||
- name: Ajout du host dans /etc/hosts si absent
|
||||
lineinfile: dest=/etc/hosts regexp='.*{{ ansible_fqdn }}$'
|
||||
line="{{ ansible_default_ipv4.address }} {{ ansible_hostname }} {{ ansible_fqdn }}"
|
||||
state=present
|
||||
# when: "'find {{ ansible_hostname }}: NXDOMAIN' in ns.stdout"
|
||||
tags: etchosts
|
||||
|
||||
- name: Modification resolv.conf pour ajouter attempts et timeout
|
||||
lineinfile: dest=/etc/resolv.conf line="{{ item.line }}"
|
||||
with_items:
|
||||
- { line: "options attempts:2" }
|
||||
- { line: "options timeout:1" }
|
||||
|
||||
- name: Desactivation de IP v6 et ZeroConf (Doc ID 1161144.1)
|
||||
lineinfile: dest=/etc/sysconfig/network line="{{ item.line }}"
|
||||
with_items:
|
||||
- { line: "NETWORKING_IPV6=no" }
|
||||
- { line: "IPV6INIT=no" }
|
||||
- { line: "NOZEROCONF=yes" }
|
||||
|
||||
- name: desactivation permanente de ipv6
|
||||
copy: src=desactivation_ipv6.conf dest=/etc/modprobe.d/desactivation_ipv6.conf
|
||||
Reference in New Issue
Block a user