-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook-copy2.yml
More file actions
34 lines (31 loc) · 840 Bytes
/
playbook-copy2.yml
File metadata and controls
34 lines (31 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: Copying content from controller to hosts
hosts: planetexpress:!farnsworth
connection: ssh
gather_facts: true
tasks:
- name: Create the new group for ipv4 access
ansible.builtin.group:
name: sysadmin
state: present
become: yes
- name: Create a sysadmin user for ipv4 access
ansible.builtin.user:
name: admin1
comment: "Example Admin"
state: present
shell: /bin/bash
system: no
createhome: yes
group: sysadmin
become: yes
- name: Copy gather fact var data into hosts
ansible.builtin.copy:
content: "{{ ansible_all_ipv4_addresses }}"
dest: /home/admin1/ipv4info.txt
backup: yes
force: yes
owner: admin1
group: sysadmin
mode: '0644'
become: yes