fix indentation
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
51907041d7
commit
d78e3aa0f0
|
@ -1,28 +1,27 @@
|
|||
---
|
||||
- block:
|
||||
- name: Restart network
|
||||
shell: sleep 2 && systemctl restart network
|
||||
async: 1
|
||||
poll: 0
|
||||
ignore_errors: true
|
||||
when: not require_reboot
|
||||
listen:
|
||||
- "network_restart"
|
||||
- name: Restart network
|
||||
shell: sleep 2 && systemctl restart network
|
||||
async: 1
|
||||
poll: 0
|
||||
ignore_errors: true
|
||||
when: not require_reboot
|
||||
listen: __network_restart
|
||||
|
||||
- name: Reboot server
|
||||
shell: sleep 2 && shutdown -r now "Reboot triggered by Ansible"
|
||||
async: 1
|
||||
poll: 0
|
||||
ignore_errors: true
|
||||
when: require_reboot
|
||||
listen:
|
||||
- "host_reboot"
|
||||
- name: Reboot server
|
||||
shell: sleep 2 && shutdown -r now "Reboot triggered by Ansible"
|
||||
async: 1
|
||||
poll: 0
|
||||
ignore_errors: true
|
||||
when: require_reboot
|
||||
listen: __host_reboot
|
||||
become: True
|
||||
become_user: root
|
||||
|
||||
- name: Waiting for host startup
|
||||
wait_for_connection:
|
||||
delay: 5
|
||||
timeout: 300
|
||||
listen:
|
||||
- "network_restart"
|
||||
- "host_reboot"
|
||||
- __network_restart
|
||||
- __host_reboot
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# Standards: 0.1
|
||||
---
|
||||
galaxy_info:
|
||||
author: xoxys
|
||||
|
@ -5,9 +6,9 @@ galaxy_info:
|
|||
license: MIT
|
||||
min_ansible_version: 2.4
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
galaxy_tags:
|
||||
- network
|
||||
dependencies:
|
||||
|
|
|
@ -1,47 +1,44 @@
|
|||
---
|
||||
- name: Setup network
|
||||
block:
|
||||
- name: Set hostname
|
||||
template:
|
||||
src: etc/hostname.j2
|
||||
dest: /etc/hostname
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
register: hostname_result
|
||||
notify:
|
||||
- host_reboot
|
||||
- block:
|
||||
- name: Set hostname
|
||||
template:
|
||||
src: etc/hostname.j2
|
||||
dest: /etc/hostname
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
register: hostname_result
|
||||
notify: __host_reboot
|
||||
|
||||
- name: Set hosts file
|
||||
template:
|
||||
src: etc/hosts.j2
|
||||
dest: /etc/hosts
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
register: hosts_result
|
||||
notify:
|
||||
- host_reboot
|
||||
- name: Set hosts file
|
||||
template:
|
||||
src: etc/hosts.j2
|
||||
dest: /etc/hosts
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
register: hosts_result
|
||||
notify: __host_reboot
|
||||
|
||||
- name: Add network interface configuration
|
||||
template:
|
||||
src: etc/sysconfig/network-scrips/ifcfg.j2
|
||||
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.key }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
with_dict: "{{ network_interfaces }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
when: item.key in ansible_interfaces or item.key.split(":")[0] in ansible_interfaces
|
||||
notify:
|
||||
- network_restart
|
||||
- name: Add network interface configuration
|
||||
template:
|
||||
src: etc/sysconfig/network-scrips/ifcfg.j2
|
||||
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.key }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
with_dict: "{{ network_interfaces }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
when: item.key in ansible_interfaces or item.key.split(":")[0] in ansible_interfaces
|
||||
notify: __network_restart
|
||||
|
||||
- name: Set dns server
|
||||
template:
|
||||
src: etc/resolv.conf.j2
|
||||
dest: /etc/resolv.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: Set dns server
|
||||
template:
|
||||
src: etc/resolv.conf.j2
|
||||
dest: /etc/resolv.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
become: True
|
||||
become_user: root
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: custom fact
|
||||
- name: Set flag require_reboot
|
||||
set_fact:
|
||||
require_reboot: "{{ true if network_fqdn != ansible_fqdn else false }}"
|
||||
- include_tasks: config.yml
|
||||
|
|
Loading…
Reference in New Issue