summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/etcd/tasks/main.yml16
-rw-r--r--roles/openshift_cli/tasks/main.yml17
-rw-r--r--roles/openshift_common/tasks/main.yml3
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py2
-rw-r--r--roles/openshift_master/tasks/main.yml16
-rw-r--r--roles/openshift_master_ca/tasks/main.yml10
-rw-r--r--roles/openshift_node/tasks/main.yml29
-rw-r--r--roles/oso_host_monitoring/handlers/main.yml6
-rw-r--r--roles/oso_host_monitoring/tasks/main.yml20
-rw-r--r--roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j243
-rw-r--r--roles/oso_host_monitoring/templates/oso-rhel7-host-monitoring.service.j2 (renamed from roles/oso_host_monitoring/templates/oso-rhel7-zagg-client.service.j2)48
-rw-r--r--roles/rhel_subscribe/tasks/enterprise.yml18
-rw-r--r--roles/rhel_subscribe/tasks/main.yml2
13 files changed, 56 insertions, 174 deletions
diff --git a/roles/etcd/tasks/main.yml b/roles/etcd/tasks/main.yml
index e83cfc33c..1e97b047b 100644
--- a/roles/etcd/tasks/main.yml
+++ b/roles/etcd/tasks/main.yml
@@ -11,24 +11,8 @@
action: "{{ ansible_pkg_mgr }} name=etcd-2.* state=present"
when: not openshift.common.is_containerized | bool
-- name: Get docker images
- command: docker images
- changed_when: false
- when: openshift.common.is_containerized | bool
- register: docker_images
-
- name: Pull etcd container
command: docker pull {{ openshift.etcd.etcd_image }}
- when: openshift.common.is_containerized | bool and openshift.etcd.etcd_image not in docker_images.stdout
-
-- name: Wait for etcd image
- command: >
- docker images
- register: docker_images
- until: openshift.etcd.etcd_image in docker_images.stdout
- retries: 30
- delay: 10
- changed_when: false
when: openshift.common.is_containerized | bool
- name: Install etcd container service file
diff --git a/roles/openshift_cli/tasks/main.yml b/roles/openshift_cli/tasks/main.yml
index 8d7686ffd..2b53c9b8e 100644
--- a/roles/openshift_cli/tasks/main.yml
+++ b/roles/openshift_cli/tasks/main.yml
@@ -3,32 +3,17 @@
role: common
local_facts:
deployment_type: "{{ openshift_deployment_type }}"
+ cli_image: "{{ osm_image | default(None) }}"
- name: Install clients
yum: pkg={{ openshift.common.service_type }}-clients state=installed
when: not openshift.common.is_containerized | bool
-- name: List Docker images
- command: >
- docker images
- register: docker_images
-
- name: Pull CLI 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: Wait for CLI image
- command: >
- docker images
- register: docker_images
- until: openshift.common.cli_image in docker_images.stdout
- retries: 30
- delay: 10
- changed_when: false
when: openshift.common.is_containerized | bool
-
- name: Create /usr/local/bin/openshift cli wrapper
template:
src: openshift.j2
diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml
index 0ee873a2b..3a2ccb59a 100644
--- a/roles/openshift_common/tasks/main.yml
+++ b/roles/openshift_common/tasks/main.yml
@@ -38,5 +38,6 @@
set_hostname_default: "{{ not openshift.common.version_greater_than_3_1_or_1_1 }}"
- name: Set hostname
- hostname: name={{ openshift.common.hostname }}
+ command: >
+ hostnamectl set-hostname {{ openshift.common.hostname }}
when: openshift_set_hostname | default(set_hostname_default) | bool
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index be2818dce..2a3d4acbd 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -730,7 +730,7 @@ def set_manageiq_facts_if_unset(facts):
raise OpenShiftFactsInternalError(
"Invalid invocation: The required facts are not set"
)
- if 'use_mangeiq' not in facts['common']:
+ if 'use_manageiq' not in facts['common']:
facts['common']['use_manageiq'] = facts['common']['version_greater_than_3_1_or_1_1']
return facts
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 397122631..3b46a0df4 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -86,25 +86,9 @@
action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-master{{ openshift_version }} state=present"
when: not openshift.common.is_containerized | bool
-- name: Get docker images
- command: docker images
- changed_when: false
- when: openshift.common.is_containerized | bool
- register: docker_images
-
- name: Pull master image
command: >
docker pull {{ openshift.master.master_image }}
- when: openshift.common.is_containerized | bool and openshift.master.master_image not in docker_images.stdout
-
-- name: Wait for master image
- command: >
- docker images
- register: docker_images
- until: openshift.master.master_image in docker_images.stdout
- retries: 30
- delay: 10
- changed_when: false
when: openshift.common.is_containerized | bool
- name: Install Master docker service file
diff --git a/roles/openshift_master_ca/tasks/main.yml b/roles/openshift_master_ca/tasks/main.yml
index 5b4c92f2b..6d9be81c0 100644
--- a/roles/openshift_master_ca/tasks/main.yml
+++ b/roles/openshift_master_ca/tasks/main.yml
@@ -13,16 +13,10 @@
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
+- name: Pull master 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
+ when: openshift.common.is_containerized | bool
- name: Create the master certificates if they do not already exist
command: >
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index 33852d7f8..0828d8e2c 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -44,41 +44,14 @@
action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-sdn-ovs{{ openshift_version }} state=present"
when: openshift.common.use_openshift_sdn and not openshift.common.is_containerized | bool
-- name: Get docker images
- command: docker images
- changed_when: false
- when: openshift.common.is_containerized | bool
- register: docker_images
-
- name: Pull node image
command: >
docker pull {{ openshift.node.node_image }}
- when: openshift.common.is_containerized | bool and openshift.node.node_image not in docker_images.stdout
-
-- name: Wait for node image
- command: >
- docker images
- register: docker_images
- until: openshift.node.node_image in docker_images.stdout
- retries: 30
- delay: 10
- changed_when: false
when: openshift.common.is_containerized | bool
-
+
- name: Pull OpenVSwitch image
command: >
docker pull {{ openshift.node.ovs_image }}
- when: openshift.common.is_containerized | bool and openshift.node.ovs_image not in docker_images.stdout
- and openshift.common.use_openshift_sdn | bool
-
-- name: Wait for OpenVSwitch image
- command: >
- docker images
- register: docker_images
- until: openshift.node.ovs_image in docker_images.stdout
- retries: 30
- delay: 10
- changed_when: false
when: openshift.common.is_containerized | bool and openshift.common.use_openshift_sdn | bool
- name: Install Node docker service file
diff --git a/roles/oso_host_monitoring/handlers/main.yml b/roles/oso_host_monitoring/handlers/main.yml
index 7863ad15b..3a5d8024c 100644
--- a/roles/oso_host_monitoring/handlers/main.yml
+++ b/roles/oso_host_monitoring/handlers/main.yml
@@ -4,9 +4,3 @@
name: "{{ osohm_host_monitoring }}"
state: restarted
enabled: yes
-
-- name: "Restart the {{ osohm_zagg_client }} service"
- service:
- name: "{{ osohm_zagg_client }}"
- state: restarted
- enabled: yes
diff --git a/roles/oso_host_monitoring/tasks/main.yml b/roles/oso_host_monitoring/tasks/main.yml
index 6ddfa3dcb..a0a453416 100644
--- a/roles/oso_host_monitoring/tasks/main.yml
+++ b/roles/oso_host_monitoring/tasks/main.yml
@@ -5,7 +5,6 @@
with_items:
- osohm_zagg_web_url
- osohm_host_monitoring
- - osohm_zagg_client
- osohm_docker_registry_url
- osohm_default_zagg_server_user
- osohm_default_zagg_server_password
@@ -37,29 +36,12 @@
- "Restart the {{ osohm_host_monitoring }} service"
register: systemd_host_monitoring
-- name: "Copy {{ osohm_zagg_client }} systemd file"
- template:
- src: "{{ osohm_zagg_client }}.service.j2"
- dest: "/etc/systemd/system/{{ osohm_zagg_client }}.service"
- owner: root
- group: root
- mode: 0644
- notify:
- - "Restart the {{ osohm_zagg_client }} service"
- register: zagg_systemd
-
- name: reload systemd
command: /usr/bin/systemctl --system daemon-reload
- when: systemd_host_monitoring | changed or zagg_systemd | changed
+ when: systemd_host_monitoring | changed
- name: "Start the {{ osohm_host_monitoring }} service"
service:
name: "{{ osohm_host_monitoring }}"
state: started
enabled: yes
-
-- name: "Start the {{ osohm_zagg_client }} service"
- service:
- name: "{{ osohm_zagg_client }}"
- state: started
- enabled: yes
diff --git a/roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2 b/roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2
deleted file mode 100644
index d18ad90fe..000000000
--- a/roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2
+++ /dev/null
@@ -1,43 +0,0 @@
-# This is a systemd file to run this docker container under systemd.
-# To make this work:
-# * pull the image (probably from ops docker registry)
-# * place this file in /etc/systemd/system without the .systemd extension
-# * run the commands:
-# systemctl daemon-reload
-# systemctl enable pcp-docker
-# systemctl start pcp-docker
-#
-#
-[Unit]
-Description=PCP Collector Contatainer
-Requires=docker.service
-After=docker.service
-
-
-[Service]
-Type=simple
-TimeoutStartSec=5m
-Environment=HOME=/etc/docker/ops
-#Slice=container-small.slice
-
-# systemd syntax '=-' ignore errors from return codes.
-ExecStartPre=-/usr/bin/docker kill "{{ osohm_host_monitoring }}"
-ExecStartPre=-/usr/bin/docker rm "{{ osohm_host_monitoring }}"
-ExecStartPre=-/usr/bin/docker pull "{{ osohm_docker_registry_url }}{{ osohm_host_monitoring }}"
-
-
-ExecStart=/usr/bin/docker run --rm --name="{{ osohm_host_monitoring }}" \
- --privileged --net=host --pid=host --ipc=host \
- -v /sys:/sys:ro -v /etc/localtime:/etc/localtime:ro \
- -v /var/lib/docker:/var/lib/docker:ro -v /run:/run \
- -v /var/log:/var/log \
- {{ osohm_docker_registry_url }}{{ osohm_host_monitoring }}
-
-ExecReload=-/usr/bin/docker stop "{{ osohm_host_monitoring }}"
-ExecReload=-/usr/bin/docker rm "{{ osohm_host_monitoring }}"
-ExecStop=-/usr/bin/docker stop "{{ osohm_host_monitoring }}"
-Restart=always
-RestartSec=30
-
-[Install]
-WantedBy=default.target
diff --git a/roles/oso_host_monitoring/templates/oso-rhel7-zagg-client.service.j2 b/roles/oso_host_monitoring/templates/oso-rhel7-host-monitoring.service.j2
index bcc8a5e03..753cad69f 100644
--- a/roles/oso_host_monitoring/templates/oso-rhel7-zagg-client.service.j2
+++ b/roles/oso_host_monitoring/templates/oso-rhel7-host-monitoring.service.j2
@@ -4,12 +4,12 @@
# * place this file in /etc/systemd/system without the .systemd extension
# * run the commands:
# systemctl daemon-reload
-# systemctl enable zagg-client-docker
-# systemctl start zagg-client-docker
+# systemctl enable oso-rhel7-host-monitoring
+# systemctl start oso-rhel7-host-monitoring
#
#
[Unit]
-Description=Zagg Client Contatainer
+Description=Openshift Host Monitoring Container
Requires=docker.service
After=docker.service
@@ -21,40 +21,52 @@ Environment=HOME=/etc/docker/ops
#Slice=container-small.slice
# systemd syntax '=-' ignore errors from return codes.
-ExecStartPre=-/usr/bin/docker kill "{{ osohm_zagg_client }}"
-ExecStartPre=-/usr/bin/docker rm "{{ osohm_zagg_client }}"
-ExecStartPre=-/usr/bin/docker pull "{{ osohm_docker_registry_url }}{{ osohm_zagg_client }}"
+ExecStartPre=-/usr/bin/docker kill "{{ osohm_host_monitoring }}"
+ExecStartPre=-/usr/bin/docker rm "{{ osohm_host_monitoring }}"
+ExecStartPre=-/usr/bin/docker pull "{{ osohm_docker_registry_url }}{{ osohm_host_monitoring }}"
+# mwoodson note 1-7-16:
+# pcp recommends mounting /run in their Dockerfile
+# /run conflicts with cron which also runs in this container.
+# I am leaving /run out for now. the guys in #pcp said that they mounted /run
+# to shared the pcp socket that is created in /run. We are not using this,
+# as far as I know.
+# This problem goes away with systemd being run in the containers and not using
+# cron but using systemd timers
+# -v /run:/run \
-ExecStart=/usr/bin/docker run --name {{ osohm_zagg_client }} \
+ExecStart=/usr/bin/docker run --name {{ osohm_host_monitoring }} \
--privileged \
--pid=host \
--net=host \
- -e ZAGG_URL={{ osohm_zagg_web_url }} \
- -e ZAGG_USER={{ osohm_default_zagg_server_user }} \
- -e ZAGG_PASSWORD={{ osohm_default_zagg_server_password }} \
+ --ipc=host \
+ -e ZAGG_URL={{ osohm_zagg_web_url }} \
+ -e ZAGG_USER={{ osohm_default_zagg_server_user }} \
+ -e ZAGG_PASSWORD={{ osohm_default_zagg_server_password }} \
-e ZAGG_CLIENT_HOSTNAME={{ ec2_tag_Name }} \
- -e ZAGG_SSL_VERIFY={{ osohm_zagg_verify_ssl }} \
+ -e ZAGG_SSL_VERIFY={{ osohm_zagg_verify_ssl }} \
-e OSO_CLUSTER_GROUP={{ cluster_group }} \
- -e OSO_CLUSTER_ID={{ oo_clusterid }} \
+ -e OSO_CLUSTER_ID={{ oo_clusterid }} \
-e OSO_HOST_TYPE={{ hostvars[inventory_hostname]['ec2_tag_host-type'] }} \
-e OSO_SUB_HOST_TYPE={{ hostvars[inventory_hostname]['ec2_tag_sub-host-type'] }} \
-v /etc/localtime:/etc/localtime \
- -v /run/pcp:/run/pcp \
+ -v /sys:/sys:ro \
+ -v /sys/fs/selinux \
+ -v /var/lib/docker:/var/lib/docker:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
- -v /var/run/openvswitch:/var/run/openvswitch \
+ -v /var/run/openvswitch:/var/run/openvswitch \
{% if hostvars[inventory_hostname]['ec2_tag_host-type'] == 'master' %}
-v /etc/openshift/master/admin.kubeconfig:/etc/openshift/master/admin.kubeconfig \
-v /etc/openshift/master/master.etcd-client.crt:/etc/openshift/master/master.etcd-client.crt \
-v /etc/openshift/master/master.etcd-client.key:/etc/openshift/master/master.etcd-client.key \
-v /etc/openshift/master/master-config.yaml:/etc/openshift/master/master-config.yaml \
{% endif %}
- {{ osohm_docker_registry_url }}{{ osohm_zagg_client }}
+ {{ osohm_docker_registry_url }}{{ osohm_host_monitoring }}
-ExecReload=-/usr/bin/docker stop "{{ osohm_zagg_client }}"
-ExecReload=-/usr/bin/docker rm "{{ osohm_zagg_client }}"
-ExecStop=-/usr/bin/docker stop "{{ osohm_zagg_client }}"
+ExecReload=-/usr/bin/docker stop "{{ osohm_host_monitoring }}"
+ExecReload=-/usr/bin/docker rm "{{ osohm_host_monitoring }}"
+ExecStop=-/usr/bin/docker stop "{{ osohm_host_monitoring }}"
Restart=always
RestartSec=30
diff --git a/roles/rhel_subscribe/tasks/enterprise.yml b/roles/rhel_subscribe/tasks/enterprise.yml
index e9e6e4bd4..08540f440 100644
--- a/roles/rhel_subscribe/tasks/enterprise.yml
+++ b/roles/rhel_subscribe/tasks/enterprise.yml
@@ -2,8 +2,24 @@
- name: Disable all repositories
command: subscription-manager repos --disable="*"
+- set_fact:
+ default_ose_version: '3.0'
+ when: deployment_type == 'enterprise'
+
+- set_fact:
+ default_ose_version: '3.1'
+ when: deployment_type in ['atomic-enterprise', 'openshift-enterprise']
+
+- set_fact:
+ ose_version: "{{ lookup('oo_option', 'ose_version') | default(default_ose_version, True) }}"
+
+- fail:
+ msg: "{{ ose_version }} is not a valid version for {{ deployment_type }} deployment type"
+ when: ( deployment_type == 'enterprise' and ose_version not in ['3.0'] ) or
+ ( deployment_type in ['atomic-enterprise', 'openshift-enterprise'] and ose_version not in ['3.1'] )
+
- name: Enable RHEL repositories
command: subscription-manager repos \
--enable="rhel-7-server-rpms" \
--enable="rhel-7-server-extras-rpms" \
- --enable="rhel-7-server-ose-3.0-rpms"
+ --enable="rhel-7-server-ose-{{ ose_version }}-rpms"
diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml
index c160ea4e9..eecfd04a0 100644
--- a/roles/rhel_subscribe/tasks/main.yml
+++ b/roles/rhel_subscribe/tasks/main.yml
@@ -41,4 +41,4 @@
command: subscription-manager subscribe --pool {{ openshift_pool_id.stdout_lines[0] }}
- include: enterprise.yml
- when: deployment_type == 'enterprise'
+ when: deployment_type in [ 'enterprise', 'atomic-enterprise', 'openshift-enterprise' ]