summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/hostname/tasks/check_mode.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/hostname/tasks/check_mode.yml')
-rw-r--r--test/integration/targets/hostname/tasks/check_mode.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/targets/hostname/tasks/check_mode.yml b/test/integration/targets/hostname/tasks/check_mode.yml
new file mode 100644
index 0000000..e25df97
--- /dev/null
+++ b/test/integration/targets/hostname/tasks/check_mode.yml
@@ -0,0 +1,20 @@
+# These are less useful (check_mode only) but run even in containers
+- block:
+ - name: Get current hostname
+ command: hostname
+ register: original
+
+ - name: Change hostname (check_mode)
+ hostname:
+ name: crocodile.ansible.test.doesthiswork.net.example.com
+ check_mode: true
+ register: hn
+
+ - name: Get current hostname again
+ command: hostname
+ register: after_hn
+
+ - assert:
+ that:
+ - hn is changed
+ - original.stdout == after_hn.stdout