summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cfme/tasks/main.yml
blob: cf5a7fdeb1e837573043e8e31c0eb303bd0e174e (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
######################################################################)
# Users, projects, and privileges

- name: Run pre-install CFME validation checks
  include: validate.yml

- name: "Ensure the CFME '{{ openshift_cfme_project }}' namespace exists"
  oc_project:
    state: present
    name: "{{ openshift_cfme_project }}"
    display_name: "{{ openshift_cfme_project_description }}"

- name: Create and Authorize CFME Accounts
  include: accounts.yml

######################################################################
# STORAGE - Initialize basic storage classes
#---------------------------------------------------------------------
# * nfs - set up NFS shares on the first master for a proof of concept
- name: Create required NFS exports for CFME app storage
  include: storage/nfs.yml
  when: openshift_cfme_storage_class == 'nfs'

#---------------------------------------------------------------------
# * external - NFS again, but pointing to a pre-configured NFS server
- name: Note Storage Type -  External NFS
  debug:
    msg: Setting up external NFS storage, openshift_cfme_storage_class is 'external'
  when: openshift_cfme_storage_class == 'external'

#---------------------------------------------------------------------
# * cloudprovider - use an existing cloudprovider based storage
- name: Note Storage Type - Cloud Provider
  debug:
    msg: Validating cloud provider storage type, openshift_cfme_storage_class is 'cloudprovider'
  when: openshift_cfme_storage_class == 'cloudprovider'

#---------------------------------------------------------------------
# * preconfigured - don't do anything, assume it's all there ready to go
- name: Note Storage Type - Preconfigured
  debug:
    msg: Skipping storage configuration, openshift_cfme_storage_class is 'preconfigured'
  when: openshift_cfme_storage_class == 'preconfigured'

######################################################################
# APPLICATION TEMPLATE
- name: Install the correct CFME app template
  include: template.yml

######################################################################
# APP & DB Storage


######################################################################

# ######################################################################
# # Let's do this

# - name: Ensure the CFME Server is created
#   oc_process:
#     namespace: "{{ openshift_cfme_project }}"
#     template_name: manageiq
#     create: True
#     params:
#       APPLICATION_IMG_NAME: "{{ openshift_cfme_application_img_name }}"
#       POSTGRESQL_IMG_NAME: "{{ openshift_cfme_postgresql_img_name }}"
#       MEMCACHED_IMG_NAME: "{{ openshift_cfme_memcached_img_name }}"
#       APPLICATION_IMG_TAG: "{{ openshift_cfme_application_img_tag }}"
#       POSTGRESQL_IMG_TAG: "{{ openshift_cfme_postgresql_img_tag }}"
#       MEMCACHED_IMG_TAG: "{{ openshift_cfme_memcached_img_tag }}"
#   register: cfme_new_app_process
#   run_once: True
#   when:
#     # User said to install CFME in their inventory
#     - openshift_cfme_install_app | bool
#     # # The server app doesn't exist already
#     # - not miq_server_check.results.results.0

# - debug:
#     var: cfme_new_app_process

# ######################################################################
# # Various cleanup steps

# # TODO: Not sure what to do about this right now. Might be able to
# # just delete it?  This currently warns about "Unable to find
# # '<TEMP_DIR>' in expected paths."
# - name: Ensure the temporary PV/App templates are erased
#   file:
#     path: "{{ item }}"
#     state: absent
#   with_fileglob:
#     - "{{ template_dir }}/*.yaml"

# - name: Ensure the temporary PV/app template directory is erased
#   file:
#     path: "{{ template_dir }}"
#     state: absent