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.
25 lines
644 B
YAML
25 lines
644 B
YAML
4 years ago
|
- name: Run hostname module for real now
|
||
|
hostname:
|
||
|
name: crocodile.ansible.test.doesthiswork.net.example.com
|
||
|
register: hn2
|
||
|
|
||
|
- name: Get hostname
|
||
|
command: hostname
|
||
|
register: current_after_hn2
|
||
|
|
||
|
- name: Run hostname again to ensure it does not change
|
||
|
hostname:
|
||
|
name: crocodile.ansible.test.doesthiswork.net.example.com
|
||
|
register: hn3
|
||
|
|
||
|
- name: Get hostname
|
||
|
command: hostname
|
||
|
register: current_after_hn3
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- hn2 is changed
|
||
|
- hn3 is not changed
|
||
|
- current_after_hn2.stdout == 'crocodile.ansible.test.doesthiswork.net.example.com'
|
||
|
- current_after_hn2.stdout == current_after_hn2.stdout
|