diff --git a/project/ping.yml b/project/ping.yml index e191458..61ca2bf 100644 --- a/project/ping.yml +++ b/project/ping.yml @@ -2,4 +2,9 @@ - hosts: all tasks: - name: Ping hosts - ansible.builtin.ping: \ No newline at end of file + ansible.builtin.ping: + +- hosts: all + roles: + - testrole + \ No newline at end of file diff --git a/project/roles/testrole/tasks/main.yml b/project/roles/testrole/tasks/main.yml new file mode 100644 index 0000000..f495e39 --- /dev/null +++ b/project/roles/testrole/tasks/main.yml @@ -0,0 +1,4 @@ +- name: create test file + ansible.builtin.template: + src: testfile.j2 + dest: /tmp/testfile.txt \ No newline at end of file diff --git a/project/roles/testrole/templates/testfile.j2 b/project/roles/testrole/templates/testfile.j2 new file mode 100644 index 0000000..a24ed45 --- /dev/null +++ b/project/roles/testrole/templates/testfile.j2 @@ -0,0 +1 @@ +this is testfile.txt on {{ inventory_hostname }} \ No newline at end of file