9fbd65958d
Change: - Move hostnamectl check out of GenericStrategy because it was incorrect for everything except the SystemdStrategy which is where it belongs. - Add some initial tests for the hostname module, though we are limited by the fact that we can't do much testing with it in containers. Test Plan: - new hostname integration tests Signed-off-by: Rick Elrod <rick@elrod.me> Co-authored-by: Sam Doran <sdoran@redhat.com>
20 lines
517 B
YAML
20 lines
517 B
YAML
# 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
|