summaryrefslogtreecommitdiffstats
path: root/playbooks/gce/openshift-cluster/join_node.yml
blob: 613bbb34fa9c3dc0cacc19a9c905a83f54484e93 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
- name: Populate oo_hosts_to_update group
  hosts: localhost
  gather_facts: no
  vars_files:
  - vars.yml
  tasks:
  - name: Evaluate oo_hosts_to_update
    add_host:
      name: "{{ node_ip }}"
      groups: oo_hosts_to_update
      ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
      ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"

- include: ../../common/openshift-cluster/update_repos_and_packages.yml

- name: Populate oo_masters_to_config host group
  hosts: localhost
  gather_facts: no
  vars_files:
  - vars.yml
  tasks:
  - name: Evaluate oo_nodes_to_config
    add_host:
      name: "{{ node_ip }}"
      ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
      ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
      groups: oo_nodes_to_config

  - name: Add to preemptible group if needed
    add_host:
      name: "{{ node_ip }}"
      ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
      ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
      groups: oo_preemptible_nodes
    when: preemptible is defined and preemptible == "true"
  
  - name: Add to not preemptible group if needed
    add_host:
      name: "{{ node_ip }}"
      ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
      ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
      groups: oo_non_preemptible_nodes
    when: preemptible is defined and  preemptible == "false"
  
  - name: Evaluate oo_first_master
    add_host:
      name: "{{ groups['tag_env-host-type-' ~ cluster_id ~ '-openshift-master'][0] }}"
      ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
      ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
      groups: oo_first_master
    when: "'tag_env-host-type-{{ cluster_id }}-openshift-master' in groups"

#- include: config.yml
- include: ../../common/openshift-node/config.yml
  vars:
    openshift_cluster_id: "{{ cluster_id }}"
    openshift_debug_level: 4
    openshift_deployment_type: "{{ deployment_type }}"
    openshift_hostname: "{{ ansible_default_ipv4.address }}"
    openshift_use_openshift_sdn: true
    os_sdn_network_plugin_name: "redhat/openshift-ovs-subnet"
    osn_cluster_dns_domain: "{{ hostvars[groups.oo_first_master.0].openshift.dns.domain }}"
    osn_cluster_dns_ip: "{{ hostvars[groups.oo_first_master.0].openshift.dns.ip }}"