diff options
author | Tomas Sedovic <tomas@sedovic.cz> | 2017-11-07 14:17:27 +1100 |
---|---|---|
committer | Tomas Sedovic <tomas@sedovic.cz> | 2017-11-07 14:17:27 +1100 |
commit | 6f4d509817f200ec2a273a097f4f048da5997925 (patch) | |
tree | ebddc919d850ec5c4d308613661063b01ae89784 /roles/hostnames | |
parent | 0cf8cf65a89ad7cac8c1cef1f743426b610adae0 (diff) | |
parent | 332f131e8e6457a03a4f1ab19abc8e4ceb897307 (diff) | |
download | openshift-6f4d509817f200ec2a273a097f4f048da5997925.tar.gz openshift-6f4d509817f200ec2a273a097f4f048da5997925.tar.bz2 openshift-6f4d509817f200ec2a273a097f4f048da5997925.tar.xz openshift-6f4d509817f200ec2a273a097f4f048da5997925.zip |
Merge ../openshift-ansible-contrib into openstack-provider-githist
This moves all the OpenStack-related code from the -contrib[1] repo
including its git history to openshift-ansible. It will then be moved
around and updated to fit the rest of the project's structure.
[1]: https://github.com/openshift/openshift-ansible-contrib
Diffstat (limited to 'roles/hostnames')
-rw-r--r-- | roles/hostnames/tasks/main.yaml | 26 | ||||
-rw-r--r-- | roles/hostnames/test/inv | 12 | ||||
l--------- | roles/hostnames/test/roles | 1 | ||||
-rw-r--r-- | roles/hostnames/test/test.retry | 3 | ||||
-rw-r--r-- | roles/hostnames/test/test.yaml | 4 | ||||
-rw-r--r-- | roles/hostnames/vars/main.yaml | 2 | ||||
-rw-r--r-- | roles/hostnames/vars/records.yaml | 28 |
7 files changed, 76 insertions, 0 deletions
diff --git a/roles/hostnames/tasks/main.yaml b/roles/hostnames/tasks/main.yaml new file mode 100644 index 000000000..c49852210 --- /dev/null +++ b/roles/hostnames/tasks/main.yaml @@ -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 }}.{{ 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 diff --git a/roles/hostnames/test/inv b/roles/hostnames/test/inv new file mode 100644 index 000000000..ffbe6e03d --- /dev/null +++ b/roles/hostnames/test/inv @@ -0,0 +1,12 @@ +[all:vars] +dns_domain=example.com + +[openshift_masters] +192.168.124.41 dns_private_ip=1.1.1.41 dns_public_ip=192.168.124.41 +192.168.124.117 dns_private_ip=1.1.1.117 dns_public_ip=192.168.124.117 + +[openshift_nodes] +192.168.124.40 dns_private_ip=1.1.1.40 dns_public_ip=192.168.124.40 + +#[dns] +#192.168.124.117 dns_private_ip=1.1.1.117 diff --git a/roles/hostnames/test/roles b/roles/hostnames/test/roles new file mode 120000 index 000000000..e2b799b9d --- /dev/null +++ b/roles/hostnames/test/roles @@ -0,0 +1 @@ +../../../roles/
\ No newline at end of file diff --git a/roles/hostnames/test/test.retry b/roles/hostnames/test/test.retry new file mode 100644 index 000000000..63fc08e4c --- /dev/null +++ b/roles/hostnames/test/test.retry @@ -0,0 +1,3 @@ +192.168.124.117 +192.168.124.40 +192.168.124.41 diff --git a/roles/hostnames/test/test.yaml b/roles/hostnames/test/test.yaml new file mode 100644 index 000000000..0c56aea51 --- /dev/null +++ b/roles/hostnames/test/test.yaml @@ -0,0 +1,4 @@ +--- +- hosts: all + roles: + - role: hostnames diff --git a/roles/hostnames/vars/main.yaml b/roles/hostnames/vars/main.yaml new file mode 100644 index 000000000..3eecb8dc4 --- /dev/null +++ b/roles/hostnames/vars/main.yaml @@ -0,0 +1,2 @@ +--- +counter: 1 diff --git a/roles/hostnames/vars/records.yaml b/roles/hostnames/vars/records.yaml new file mode 100644 index 000000000..0cadc8181 --- /dev/null +++ b/roles/hostnames/vars/records.yaml @@ -0,0 +1,28 @@ +--- +- name: "Building Records" + set_fact: + dns_records_add: + - view: private + zone: example.com + entries: + - type: A + hostname: master1.example.com + ip: 172.16.15.94 + - type: A + hostname: node1.example.com + ip: 172.16.15.86 + - type: A + hostname: node2.example.com + ip: 172.16.15.87 + - view: public + zone: example.com + entries: + - type: A + hostname: master1.example.com + ip: 10.3.10.116 + - type: A + hostname: node1.example.com + ip: 10.3.11.46 + - type: A + hostname: node2.example.com + ip: 10.3.12.6 |