diff --git a/examples/config/cp_with_templates/Makefile b/examples/config/cp_with_templates/Makefile new file mode 100644 index 0000000..f586f68 --- /dev/null +++ b/examples/config/cp_with_templates/Makefile @@ -0,0 +1,5 @@ +run: + gobble gobble + ssh root@gobble-test.sikademo.com cat /tmp/hello.txt + ssh root@gobble-test.sikademo.com cat /tmp/world.txt + diff --git a/examples/config/cp_with_templates/gobblefile.yml b/examples/config/cp_with_templates/gobblefile.yml new file mode 100644 index 0000000..874c9b6 --- /dev/null +++ b/examples/config/cp_with_templates/gobblefile.yml @@ -0,0 +1,20 @@ +meta: + schema_version: 3 +global: + no_strict_host_key_checking: true +hosts: + all: + - ssh_target: root@gobble-test.sikademo.com + vars: + filename: hello + - ssh_target: root@gobble-test.sikademo.com + vars: + filename: world +plays: + - name: Copy file to server + hosts: [all] + tasks: + - name: Replace 1 + cp: + local_src: hello.txt + remote_dst: /tmp/{{.Vars.filename}}.txt diff --git a/examples/config/cp_with_templates/hello.txt b/examples/config/cp_with_templates/hello.txt new file mode 100644 index 0000000..476fa3b --- /dev/null +++ b/examples/config/cp_with_templates/hello.txt @@ -0,0 +1 @@ +Gobble Gobble...!