diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/aws-hostname.yml b/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/aws-hostname.yml deleted file mode 100644 index 19db34644f..0000000000 --- a/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/aws-hostname.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: Set hostname on AWS - hostname: - name: '{{ inventory_hostname }}' - -- name: Disable AWS cloud hostname - lineinfile: - dest: /etc/cloud/cloud.cfg - line: 'preserve_hostname: true' - state: present \ No newline at end of file diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/main.yml index f6c2129fd7..5b4f9c0bae 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/main.yml @@ -114,9 +114,7 @@ tags: - security -- include_tasks: aws-hostname.yml - when: - - provider == "aws" +- include_tasks: set-hostname.yml - name: Include logrotate configuration tasks include_tasks: configure-logrotate.yml diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/set-hostname.yml b/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/set-hostname.yml new file mode 100644 index 0000000000..421e8d8ed7 --- /dev/null +++ b/core/src/epicli/data/common/ansible/playbooks/roles/common/tasks/set-hostname.yml @@ -0,0 +1,16 @@ +--- +# "Changing the hostname always" seems to be working because we always put +# all of the play hosts inside /etc/hosts files on every cluster node. +# It makes an illusion that Epiphany has control over DNS inside the underlying network. +- name: Set hostname + hostname: + name: '{{ inventory_hostname }}' + +# https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname-rhel7-centos7/ +- name: Disable AWS cloud hostname + lineinfile: + dest: /etc/cloud/cloud.cfg + line: 'preserve_hostname: true' + state: present + when: + - provider == "aws"