Commit 48fd15f3 authored by nanahira's avatar nanahira

use block for hosts

parent f1678a2f
...@@ -24,3 +24,6 @@ vm_agents_status: present ...@@ -24,3 +24,6 @@ vm_agents_status: present
customization: true customization: true
nvidia_driver_version: null nvidia_driver_version: null
cloud_kernel: auto # or enabled / disabled cloud_kernel: auto # or enabled / disabled
railgun:
destination: chnroute
remoteGatewayId: 31
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
when: inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192' when: inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
- name: hostname hosts - name: hostname hosts
become: true become: true
lineinfile: blockinfile:
dest: /etc/hosts path: /etc/hosts
regexp: "^{{ ansible_default_ipv4.address }}" marker: '# Generated by MyCard Init'
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname_short }}" 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' when: inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
- name: clean aliyun - name: clean aliyun
become: true 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