ansible/test/integration/targets/hostname/tasks/RedHat.yml
Rick Elrod 9fbd65958d
hostname: hostnamectl check -> SystemdStrategy ()
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>
2020-07-09 20:04:23 -05:00

15 lines
495 B
YAML

- name: Make sure we used SystemdStrategy...
lineinfile:
path: "{{ _hostname_file }}"
line: crocodile.ansible.test.doesthiswork.net.example.com
check_mode: true
register: etc_hostname
failed_when: etc_hostname is changed
- name: ...and not RedhatStrategy
lineinfile:
path: /etc/sysconfig/network
line: HOSTNAME=crocodile.ansible.test.doesthiswork.net.example.com
check_mode: true
register: etc_sysconfig_network
failed_when: etc_sysconfig_network is not changed