-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook-file04.yml
More file actions
23 lines (20 loc) · 814 Bytes
/
playbook-file04.yml
File metadata and controls
23 lines (20 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
- name: A playbook showing the file module
hosts: planetexpress
tasks:
- name: Create directory where Space Station documents will reside
become_user: root
become: true
file:
# the var "ansible_user" is a host variable AND connection variable
path: "/home/{{ ansible_user }}/station_docs/"
state: directory
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
mode: "0755"
- name: "Create directory where Space Station documents will reside"
copy:
# the var "ansible_user" is a host variable AND connection variable
# ansible_date_time.date is defined by gather_facts
dest: "/home/{{ ansible_user }}/station_docs/navdata-{{ ansible_date_time.date }}.txt"
content: "Earth\nMars\nSaturn\nEuropa"