diff options
author | Scott Dodson <sdodson@redhat.com> | 2017-11-16 08:53:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 08:53:17 -0500 |
commit | 8a85bc3a00efb654238a58e1faa2a2629d9360b1 (patch) | |
tree | 693186d957899c6e3cd38a6ae5aa66392814ff15 /roles/openshift_openstack/tasks/hostname.yml | |
parent | 7dcc6292e2ca89fe22675491299cf5853860bed8 (diff) | |
parent | 2e9d134d4564d87dbbc7853b07204f7f44ee01e6 (diff) | |
download | openshift-8a85bc3a00efb654238a58e1faa2a2629d9360b1.tar.gz openshift-8a85bc3a00efb654238a58e1faa2a2629d9360b1.tar.bz2 openshift-8a85bc3a00efb654238a58e1faa2a2629d9360b1.tar.xz openshift-8a85bc3a00efb654238a58e1faa2a2629d9360b1.zip |
Merge pull request #6039 from tomassedovic/openstack-provider-githist
Add the OpenStack provider
Diffstat (limited to 'roles/openshift_openstack/tasks/hostname.yml')
-rw-r--r-- | roles/openshift_openstack/tasks/hostname.yml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/roles/openshift_openstack/tasks/hostname.yml b/roles/openshift_openstack/tasks/hostname.yml new file mode 100644 index 000000000..e1a18425f --- /dev/null +++ b/roles/openshift_openstack/tasks/hostname.yml @@ -0,0 +1,26 @@ +--- +- name: Setting Hostname Fact + set_fact: + new_hostname: "{{ custom_hostname | default(inventory_hostname_short) }}" + +- name: Setting FQDN Fact + set_fact: + new_fqdn: "{{ new_hostname }}.{{ openshift_openstack_full_dns_domain }}" + +- name: Setting hostname and DNS domain + hostname: name="{{ new_fqdn }}" + +- name: Check for cloud.cfg + stat: path=/etc/cloud/cloud.cfg + register: cloud_cfg + +- name: Prevent cloud-init updates of hostname/fqdn (if applicable) + lineinfile: + dest: /etc/cloud/cloud.cfg + state: present + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + with_items: + - { regexp: '^ - set_hostname', line: '# - set_hostname' } + - { regexp: '^ - update_hostname', line: '# - update_hostname' } + when: cloud_cfg.stat.exists == True |