summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master_ca/tasks/main.yml
blob: 5b4c92f2b7dd61b9b9a22c9acd8d097437cd6762 (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
---
- name: Install the base package for admin tooling
  action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version  }} state=present"
  when: not openshift.common.is_containerized | bool
  register: install_result

- name: Reload generated facts
  openshift_facts:
  when: install_result | changed

- name: Create openshift_master_config_dir if it doesn't exist
  file:
    path: "{{ openshift_master_config_dir }}"
    state: directory

- name: Get docker images
  command: docker images
  changed_when: false
  when: openshift.common.is_containerized | bool
  register: docker_images

- name: Pull required docker image
  command: >
    docker pull {{ openshift.common.cli_image }}
  when: openshift.common.is_containerized | bool and openshift.common.cli_image not in docker_images.stdout

- name: Create the master certificates if they do not already exist
  command: >
    {{ openshift.common.admin_binary }} create-master-certs
      --hostnames={{ master_hostnames | join(',') }}
      --master={{ openshift.master.api_url }}
      --public-master={{ openshift.master.public_api_url }}
      --cert-dir={{ openshift_master_config_dir }} --overwrite=false
  when: master_certs_missing