2 подписчика
Плейбук для получения данных с DNS сервера - hosts: localhost
gather_facts: no
become: yes
vars:
remove_strings: [has address]
tasks:
- name: create directory
file: path=/etc/ansible/tmp state=directory
- name: output RTR-HQ
command: "host rtr-hq"
register: rtrhq
- debug: var=rtrhq
- copy:
content: "{{ rtrhq.stdout | replace('\\n', '\n') }}"
dest: /etc/ansible/tmp/rtrhq.out
- replace:
path: /etc/ansible/tmp/rtrhq.out
regexp: '\b{{ item }}\b\s?'
replace: '- '
loop: "{{ remove_strings }}"
- name: output RTR-BR
command: "host rtr-br"
register: rtrbr
- debug: var=rtrbr
- copy:
content: "{{ rtrbr...