diff options
author | Jason DeTiberus <jdetiber@redhat.com> | 2015-02-17 22:33:33 -0500 |
---|---|---|
committer | Jason DeTiberus <jdetiber@redhat.com> | 2015-02-24 23:10:37 -0500 |
commit | 4ac06057c9a77626bb181c22a5f1adc8014b13d2 (patch) | |
tree | c8ab69e2e65de32d2f29771fb47fcce78fe5dd04 /roles/openshift_common/tasks | |
parent | 114fcaac2a8f8e3d68baf8945f8991b1da9763ee (diff) | |
download | openshift-4ac06057c9a77626bb181c22a5f1adc8014b13d2.tar.gz openshift-4ac06057c9a77626bb181c22a5f1adc8014b13d2.tar.bz2 openshift-4ac06057c9a77626bb181c22a5f1adc8014b13d2.tar.xz openshift-4ac06057c9a77626bb181c22a5f1adc8014b13d2.zip |
create openshift_common role
- move common openshift logic into openshift_common
- set openshift_common as a dependency for openshift_node and openshift_master
- rename role variables to openshift_* to be more descriptive
- start recording local_facts on the openshift hosts
- clean up firewalld config to be a bit more dry
- Update firewall ports for https, make sure http rules are removed
- Replace references to ansible_eth0.ipv4.address with
ansible_default_ipv4.address
Diffstat (limited to 'roles/openshift_common/tasks')
-rw-r--r-- | roles/openshift_common/tasks/firewall.yml | 34 | ||||
-rw-r--r-- | roles/openshift_common/tasks/main.yml | 14 | ||||
-rw-r--r-- | roles/openshift_common/tasks/set_facts.yml | 9 |
3 files changed, 57 insertions, 0 deletions
diff --git a/roles/openshift_common/tasks/firewall.yml b/roles/openshift_common/tasks/firewall.yml new file mode 100644 index 000000000..514466769 --- /dev/null +++ b/roles/openshift_common/tasks/firewall.yml @@ -0,0 +1,34 @@ +--- +# TODO: Ansible 1.9 will eliminate the need for separate firewalld tasks for +# enabling rules and making them permanent with the immediate flag +- name: "Add firewalld allow rules" + firewalld: + port: "{{ item.port }}" + permanent: false + state: enabled + with_items: allow + when: allow is defined + +- name: "Persist firewalld allow rules" + firewalld: + port: "{{ item.port }}" + permanent: true + state: enabled + with_items: allow + when: allow is defined + +- name: "Remove firewalld allow rules" + firewalld: + port: "{{ item.port }}" + permanent: false + state: disabled + with_items: deny + when: deny is defined + +- name: "Persist removal of firewalld allow rules" + firewalld: + port: "{{ item.port }}" + permanent: true + state: disabled + with_items: deny + when: deny is defined diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml new file mode 100644 index 000000000..9043c3d8e --- /dev/null +++ b/roles/openshift_common/tasks/main.yml @@ -0,0 +1,14 @@ +--- +# fixme: Once openshift stops resolving hostnames for node queries remove this... +- name: Set hostname to IP Addr (WORKAROUND) + hostname: name={{ openshift_bind_ip }} + +- name: Configure local facts file + file: path=/etc/ansible/facts.d/ state=directory mode=0750 + +- name: Set common OpenShift facts + include: set_facts.yml + facts: + - { section: common, option: env, value: "{{ openshift_env | default('default') }}" } + - { section: common, option: host_type, value: "{{ openshift_host_type }}" } + - { section: common, option: debug_level, value: "{{ openshift_debug_level }}" } diff --git a/roles/openshift_common/tasks/set_facts.yml b/roles/openshift_common/tasks/set_facts.yml new file mode 100644 index 000000000..349eecd1d --- /dev/null +++ b/roles/openshift_common/tasks/set_facts.yml @@ -0,0 +1,9 @@ +--- +- name: "Setting local_facts" + ini_file: + dest: /etc/ansible/facts.d/openshift.fact + mode: 0640 + section: "{{ item.section }}" + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: facts |