mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
517 B
YAML
21 lines
517 B
YAML
4 years ago
|
# 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
|