Commit 48fd15f3 authored by nanahira's avatar nanahira

use block for hosts

parent f1678a2f
......@@ -24,3 +24,6 @@ vm_agents_status: present
customization: true
nvidia_driver_version: null
cloud_kernel: auto # or enabled / disabled
railgun:
destination: chnroute
remoteGatewayId: 31
......@@ -19,10 +19,10 @@
when: inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
- name: hostname hosts
become: true
lineinfile:
dest: /etc/hosts
regexp: "^{{ ansible_default_ipv4.address }}"
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname_short }}"
blockinfile:
path: /etc/hosts
marker: '# Generated by MyCard Init'
block: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname_short }}"
when: inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
- name: clean aliyun
become: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment