remove deprecated parameters of blockinfile module (#3581)

This commit is contained in:
Louis 2018-10-30 20:56:58 +08:00 committed by k8s-ci-robot
parent 22c234040e
commit a84508d6b9
5 changed files with 6 additions and 11 deletions

View file

@ -5,7 +5,7 @@
- name: Add domain/search/nameservers/options to resolv.conf - name: Add domain/search/nameservers/options to resolv.conf
blockinfile: blockinfile:
dest: "{{resolvconffile}}" path: "{{resolvconffile}}"
block: |- block: |-
{% for item in [domainentry] + [searchentries] + nameserverentries.split(',') -%} {% for item in [domainentry] + [searchentries] + nameserverentries.split(',') -%}
{{ item }} {{ item }}
@ -17,7 +17,6 @@
insertbefore: BOF insertbefore: BOF
create: yes create: yes
backup: yes backup: yes
follow: yes
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
notify: Preinstall | restart network notify: Preinstall | restart network

View file

@ -1,7 +1,7 @@
--- ---
- name: Hosts | populate inventory into hosts file - name: Hosts | populate inventory into hosts file
blockinfile: blockinfile:
dest: /etc/hosts path: /etc/hosts
block: |- block: |-
{% for item in (groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]))|unique -%}{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item]['ansible_default_ipv4']['address'])) }}{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }}.{{ dns_domain }} {{ hostvars[item]['ansible_hostname'] }}{% endif %} {{ item }} {{ item }}.{{ dns_domain }} {% for item in (groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]))|unique -%}{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item]['ansible_default_ipv4']['address'])) }}{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }}.{{ dns_domain }} {{ hostvars[item]['ansible_hostname'] }}{% endif %} {{ item }} {{ item }}.{{ dns_domain }}
{% endfor %} {% endfor %}

View file

@ -5,12 +5,11 @@
{% for item in [ supersede_domain, supersede_search, supersede_nameserver ] -%} {% for item in [ supersede_domain, supersede_search, supersede_nameserver ] -%}
{{ item }} {{ item }}
{% endfor %} {% endfor %}
dest: "{{dhclientconffile}}" path: "{{dhclientconffile}}"
create: yes create: yes
state: present state: present
insertbefore: BOF insertbefore: BOF
backup: yes backup: yes
follow: yes
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
notify: Preinstall | restart network notify: Preinstall | restart network
when: dhclientconffile is defined when: dhclientconffile is defined

View file

@ -5,10 +5,9 @@
- name: Remove kubespray specific config from dhclient config - name: Remove kubespray specific config from dhclient config
blockinfile: blockinfile:
dest: "{{dhclientconffile}}" path: "{{dhclientconffile}}"
state: absent state: absent
backup: yes backup: yes
follow: yes
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
when: dhclientconffile is defined when: dhclientconffile is defined
notify: Preinstall | restart network notify: Preinstall | restart network

View file

@ -177,9 +177,8 @@
- name: reset | remove dns settings from dhclient.conf - name: reset | remove dns settings from dhclient.conf
blockinfile: blockinfile:
dest: "{{ item }}" path: "{{ item }}"
state: absent state: absent
follow: yes
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
failed_when: false failed_when: false
with_items: with_items:
@ -191,9 +190,8 @@
- name: reset | remove host entries from /etc/hosts - name: reset | remove host entries from /etc/hosts
blockinfile: blockinfile:
dest: "/etc/hosts" path: "/etc/hosts"
state: absent state: absent
follow: yes
marker: "# Ansible inventory hosts {mark}" marker: "# Ansible inventory hosts {mark}"
tags: tags:
- files - files