From 4331dd3d9056cd85001766ecd06aaa0517f556cd Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Mon, 30 Jun 2014 20:56:10 +0000 Subject: [PATCH] Give this a try for rhel7 hosts. --- roles/base/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index b635643368..52ec522e02 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -12,6 +12,10 @@ - packages - base +- name: make sure hostname is set right on rhel7 hosts + command: hostnamectl set-hostname {{ ansible_fqdn }} + when: ( ansible_fqdn != inventory_hostname ) and ansible_distribution_major_version == '7' + - name: sshd_config copy: src={{ item }} dest=/etc/ssh/sshd_config mode=600 with_first_found: