Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ansible@control lesson8]$ cat et.yaml
- ---
- # replace copy content with bliock in file
- - name: injecting ansible1 facts
- hosts: all
- vars:
- remote_dir: /etc/ansible/facts.d
- facts_file: ansible1.fact
- tasks:
- - name: create fact dir
- file:
- state: directory
- recurse: yes
- path: "{{ remote_dir }}"
- - name: install facts ansible1
- copy:
- content: 'type=production'
- dest: "{{ remote_dir }}/localfact.fact"
- when: ansible_hostname == "ansible1"
- - name: install on ansible2
- copy:
- content: 'type=testing'
- dest: "{{ remote_dir }}/localfact.fact"
- when: ansible_hostname == "ansible2"
- - name: install vsftpd conditional
- hosts: all
- tasks:
- - name: install vsftpd
- yum:
- name: vsftpd
- state: present
- when: ansible_facts.ansible_local.ansible1.servertype.type == "production"
- - name: enable vsftpd
- service:
- name: vsftpd
- enabled: yes
- - name: create readme file
- copy:
- content: "Welcome to this FTP server"
- dest: /var/ftp/pub/README
- force: no
- mode: 0444
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement