summaryrefslogtreecommitdiffstats
path: root/roles/openshift_common/tasks/main.yml
blob: 0ee873a2b165fd93230b27bd14e9f36227f3d2c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- fail:
    msg: Flannel can not be used with openshift sdn
  when: openshift_use_openshift_sdn | default(false) | bool and openshift_use_flannel | default(false) | bool

- fail:
    msg: openshift_hostname must be 64 characters or less
  when: openshift_hostname is defined and openshift_hostname | length > 64

- name: Set common Cluster facts
  openshift_facts:
    role: common
    local_facts:
      cluster_id: "{{ openshift_cluster_id | default('default') }}"
      debug_level: "{{ openshift_debug_level | default(2) }}"
      hostname: "{{ openshift_hostname | default(None) }}"
      install_examples: "{{ openshift_install_examples | default(True) }}"
      ip: "{{ openshift_ip | default(None) }}"
      public_hostname: "{{ openshift_public_hostname | default(None) }}"
      public_ip: "{{ openshift_public_ip | default(None) }}"
      use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
      sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
      deployment_type: "{{ openshift_deployment_type }}"
      use_fluentd: "{{ openshift_use_fluentd | default(None) }}"
      use_flannel: "{{ openshift_use_flannel | default(None) }}"
      use_manageiq: "{{ openshift_use_manageiq | default(None) }}"

- name: Install the base package for versioning
  action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') }} state=present"
  when: not openshift.common.is_containerized | bool

- name: Set version facts
  openshift_facts:

  # For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
  # hostname by default.
- set_fact:
    set_hostname_default: "{{ not openshift.common.version_greater_than_3_1_or_1_1 }}"

- name: Set hostname
  hostname: name={{ openshift.common.hostname }}
  when: openshift_set_hostname | default(set_hostname_default) | bool