-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- name: lineinblock usage example | ||
hosts: localhost | ||
vars_files: | ||
vars/lineinblock | ||
tasks: | ||
- name: managing /etc/hosts copy example | ||
# don't forget to add the pipe and permissions are {{ content.stat .permissions }} | ||
blockinfile: | ||
path: /home/{{ user }}/hosts | ||
block: | | ||
192.168.0.23 host1.rhce-ex194.com | ||
192.168.0.24 host2.rhce-ex194.com | ||
192.168.0.25 host3.rhce.ex194.com | ||
state: present | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: using the file module | ||
hosts: localhost | ||
vars: | ||
fullpath: /tmp/newdir/newsubdir | ||
vars_files: | ||
vars/lineinblock | ||
tasks: | ||
- name: create dir and subdir | ||
file: | ||
path: "{{ fullpath }}" | ||
state: directory #could be file, directory, touch or absent | ||
mode: 0770 | ||
owner: "{{ user }}" | ||
group: "{{ user }}" | ||
recurse: true # needed when state is set to directory | ||
- name: create a file | ||
file: | ||
path: "{{ fullpath }}/newfile" | ||
state: touch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$ANSIBLE_VAULT;1.1;AES256 | ||
30656164363831323231333437393338366539326264306264653963653032623631623533656239 | ||
3463616262333632323139353131653962313962626336360a363931623265663534613736336361 | ||
33653435343933386561366639353161633533643938323164346363313439383831323334303933 | ||
3966366330383139350a343362356165313732623165373132376237393339333636646363346632 | ||
33636331396266333034386535616437363561346232386165373236373438643465 |