summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cloud_provider/tasks/gce.yml
blob: 9e1c31b1d3dbbc90b93785e54c12ef48c44a400f (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
---
- name: check variables are passed
  fail:
    msg: "Ensure correct variables are defined for gcp. {{ item }}"
  when: item == ''
  with_items:
  - "{{ openshift_gcp_project }}"
  - "{{ openshift_gcp_prefix }}"

# Work around ini_file create option in 2.2 which defaults to no
- name: Create cloud config file
  file:
    dest: "{{ openshift.common.config_base }}/cloudprovider/gce.conf"
    state: touch
    mode: 0660
    owner: root
    group: root
  changed_when: false

- name: Configure GCE cloud provider
  ini_file:
    dest: "{{ openshift.common.config_base }}/cloudprovider/gce.conf"
    section: Global
    option: "{{ item.key }}"
    value: "{{ item.value }}"
  with_items:
  - { key: 'project-id', value: '{{ openshift_gcp_project }}' }
  - { key: 'network-name', value: '{{ openshift_gcp_network_name }}' }
  - { key: 'node-tags', value: '{{ openshift_gcp_prefix }}ocp' }
  - { key: 'node-instance-prefix', value: '{{ openshift_gcp_prefix }}' }
  - { key: 'multizone', value: 'false' }