From 3e533e199aa9262f5ca45f8311e82e975cde73b9 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 1 May 2015 13:57:30 -0700 Subject: * Deploy services from common playbook --- playbooks/common/openshift-cluster/create_services.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 playbooks/common/openshift-cluster/create_services.yml (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-cluster/create_services.yml b/playbooks/common/openshift-cluster/create_services.yml new file mode 100644 index 000000000..c85db5234 --- /dev/null +++ b/playbooks/common/openshift-cluster/create_services.yml @@ -0,0 +1,14 @@ +--- +- name: Debug Deploy OpenShift Services + hosts: localhost + gather_facts: no + tasks: + - debug: var=create_services__master + +- name: Deploy OpenShift Services + hosts: "{{ create_services__master }}" + connection: ssh + gather_facts: yes + roles: + - openshift_registry + - openshift_router -- cgit v1.2.3 From 9873607d36f974114da1177451761ee053e38d71 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 29 May 2015 14:35:48 -0700 Subject: Install fluentd on nodes and master * Configure fluentd to aggragate container logs --- playbooks/common/openshift-master/config.yml | 1 + playbooks/common/openshift-node/config.yml | 1 + 2 files changed, 2 insertions(+) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 05822d118..2566f979e 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -6,6 +6,7 @@ roles: - openshift_master - { role: openshift_sdn_master, when: openshift.common.use_openshift_sdn | bool } + - fluentd_master tasks: - name: Create group for deployment type group_by: key=oo_masters_deployment_type_{{ openshift.common.deployment_type }} diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 96641a274..b371312bc 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -96,6 +96,7 @@ roles: - openshift_node - { role: openshift_sdn_node, when: openshift.common.use_openshift_sdn | bool } + - fluentd_node tasks: - name: Create group for deployment type group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }} -- cgit v1.2.3 From 205b22f62b91deebaf87c1e33c8f76631d8ce2d5 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 1 Jun 2015 10:40:08 -0700 Subject: * Make fluentd deployment optional with openshift_use_fluentd --- playbooks/common/openshift-master/config.yml | 2 +- playbooks/common/openshift-node/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 2566f979e..4df64e95f 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -6,7 +6,7 @@ roles: - openshift_master - { role: openshift_sdn_master, when: openshift.common.use_openshift_sdn | bool } - - fluentd_master + - { role: fluentd_master, when openshift.common.use_fluentd | bool } tasks: - name: Create group for deployment type group_by: key=oo_masters_deployment_type_{{ openshift.common.deployment_type }} diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index b371312bc..70711e39b 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -96,7 +96,7 @@ roles: - openshift_node - { role: openshift_sdn_node, when: openshift.common.use_openshift_sdn | bool } - - fluentd_node + - { role: fluentd_node, when: openshift.common.use_fluentd | bool } tasks: - name: Create group for deployment type group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }} -- cgit v1.2.3 From a2d9ea46fce456b2d4f890d6d321fa36e5cc6e2e Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 1 Jun 2015 11:49:22 -0700 Subject: * Rename create_services__master to g_svc_master --- playbooks/common/openshift-cluster/create_services.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-cluster/create_services.yml b/playbooks/common/openshift-cluster/create_services.yml index c85db5234..e70709d19 100644 --- a/playbooks/common/openshift-cluster/create_services.yml +++ b/playbooks/common/openshift-cluster/create_services.yml @@ -1,12 +1,6 @@ --- -- name: Debug Deploy OpenShift Services - hosts: localhost - gather_facts: no - tasks: - - debug: var=create_services__master - - name: Deploy OpenShift Services - hosts: "{{ create_services__master }}" + hosts: "{{ g_svc_master }}" connection: ssh gather_facts: yes roles: -- cgit v1.2.3 From 67afaa13ee375def01960004195254b46cddd0db Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 3 Jun 2015 09:29:46 -0700 Subject: Infrastructure - Add service action to bin/cluster * Add necessary playbooks/roles * Cleanup bin/cluster to meet new design guide lines --- playbooks/common/openshift-master/service.yml | 18 ++++++++++++++++++ playbooks/common/openshift-node/service.yml | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 playbooks/common/openshift-master/service.yml create mode 100644 playbooks/common/openshift-node/service.yml (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-master/service.yml b/playbooks/common/openshift-master/service.yml new file mode 100644 index 000000000..5636ad156 --- /dev/null +++ b/playbooks/common/openshift-master/service.yml @@ -0,0 +1,18 @@ +--- +- name: Populate g_service_masters host group if needed + hosts: localhost + gather_facts: no + tasks: + - fail: msg="new_cluster_state is required to be injected in this playbook" + when: new_cluster_state is not defined + + - name: Evaluate g_service_masters + add_host: name={{ item }} groups=g_service_masters + with_items: oo_host_group_exp | default([]) + +- name: Change openshift-master state on master instance(s) + hosts: g_service_masters + connection: ssh + gather_facts: no + tasks: + - service: name=openshift-master state="{{ new_cluster_state }}" diff --git a/playbooks/common/openshift-node/service.yml b/playbooks/common/openshift-node/service.yml new file mode 100644 index 000000000..f76df089f --- /dev/null +++ b/playbooks/common/openshift-node/service.yml @@ -0,0 +1,18 @@ +--- +- name: Populate g_service_nodes host group if needed + hosts: localhost + gather_facts: no + tasks: + - fail: msg="new_cluster_state is required to be injected in this playbook" + when: new_cluster_state is not defined + + - name: Evaluate g_service_nodes + add_host: name={{ item }} groups=g_service_nodes + with_items: oo_host_group_exp | default([]) + +- name: Change openshift-node state on node instance(s) + hosts: g_service_nodes + connection: ssh + gather_facts: no + tasks: + - service: name=openshift-node state="{{ new_cluster_state }}" -- cgit v1.2.3 From 2283750d0ad8b24a823f034ebd6172526c535943 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Sat, 6 Jun 2015 13:40:18 -0400 Subject: add use_fluentd to openshift_facts - Move use_fluentd into openshift_facts proper - default use_fluentd to False unless deployment_type == origin --- playbooks/common/openshift-master/config.yml | 6 ++++-- playbooks/common/openshift-node/config.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 4df64e95f..a9a4e6afc 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -5,8 +5,10 @@ openshift_sdn_master_url: https://{{ openshift.common.hostname }}:4001 roles: - openshift_master - - { role: openshift_sdn_master, when: openshift.common.use_openshift_sdn | bool } - - { role: fluentd_master, when openshift.common.use_fluentd | bool } + - role: openshift_sdn_master + when: openshift.common.use_openshift_sdn | bool + - role: fluentd_master + when: openshift.common.use_fluentd | bool tasks: - name: Create group for deployment type group_by: key=oo_masters_deployment_type_{{ openshift.common.deployment_type }} diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 70711e39b..55abedfe7 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -95,8 +95,10 @@ dest: "{{ openshift_node_cert_dir }}" roles: - openshift_node - - { role: openshift_sdn_node, when: openshift.common.use_openshift_sdn | bool } - - { role: fluentd_node, when: openshift.common.use_fluentd | bool } + - role: openshift_sdn_node + when: openshift.common.use_openshift_sdn | bool + - role: fluentd_node + when: openshift.common.use_fluentd | bool tasks: - name: Create group for deployment type group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }} -- cgit v1.2.3 From b57392ddd54bbff225ba83dd5a5bf40ea99344a4 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 30 Apr 2015 17:04:15 -0400 Subject: Accomodate upstream configuration change - Master config and certificates are now in /etc/openshift/master - Node config is now in /etc/openshift/node - Several certificates have been renamed to accomodate a flattening of structure to accomodate secret storage - Add openshift_data_dir to ensure etcd and volumes are stored in /var/lib/openshift - Add openshift_generated_configs_dir --- playbooks/common/openshift-node/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 55abedfe7..feaeaab95 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -60,7 +60,7 @@ - name: Create a tarball of the node config directories command: tar -czvf {{ sync_tmpdir }}/{{ item.openshift.common.hostname }}.tgz ./ args: - chdir: "{{ openshift_cert_dir }}/node-{{ item.openshift.common.hostname }}" + chdir: "{{ openshift_generated_configs_dir }}/node-{{ item.openshift.common.hostname }}" with_items: openshift_nodes changed_when: False -- cgit v1.2.3 From 94a77cb1d81b6e4e316ae679890df4994816532f Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 22 May 2015 13:13:17 -0400 Subject: Templatize configs and 0.5.2 changes - Templatize node config - Templatize master config - Integrated sdn changes - Updates for openshift_facts - Added support for node, master and sdn related changes - registry_url - added identity provider facts - Removed openshift_sdn_* roles - Install httpd-tools if configuring htpasswd auth - Remove references to external_id - Setting external_id interferes with nodes associating with the generated node object when pre-registering nodes. - osc/oc and osadm/oadm binary detection in openshift_facts Misc Changes: - make non-errata puddle default for byo example - comment out master in list of nodes in inventory/byo/hosts - remove non-error errors from fluentd_* roles - Use admin kubeconfig instead of openshift-client --- playbooks/common/openshift-master/config.yml | 4 -- playbooks/common/openshift-node/config.yml | 80 ++++++++++++++-------------- 2 files changed, 41 insertions(+), 43 deletions(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index a9a4e6afc..052ed14c7 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -1,12 +1,8 @@ --- - name: Configure master instances hosts: oo_masters_to_config - vars: - openshift_sdn_master_url: https://{{ openshift.common.hostname }}:4001 roles: - openshift_master - - role: openshift_sdn_master - when: openshift.common.use_openshift_sdn | bool - role: fluentd_master when: openshift.common.use_fluentd | bool tasks: diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index feaeaab95..a650796c7 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -4,9 +4,9 @@ roles: - openshift_facts tasks: - # Since the master is registering the nodes before they are configured, we - # need to make sure to set the node properties beforehand if we do not want - # the defaults + # Since the master is generating the node certificates before they are + # configured, we need to make sure to set the node properties beforehand if + # we do not want the defaults - openshift_facts: role: "{{ item.role }}" local_facts: "{{ item.local_facts }}" @@ -18,13 +18,26 @@ deployment_type: "{{ openshift_deployment_type }}" - role: node local_facts: - external_id: "{{ openshift_node_external_id | default(None) }}" resources_cpu: "{{ openshift_node_resources_cpu | default(None) }}" resources_memory: "{{ openshift_node_resources_memory | default(None) }}" pod_cidr: "{{ openshift_node_pod_cidr | default(None) }}" labels: "{{ openshift_node_labels | default(None) }}" annotations: "{{ openshift_node_annotations | default(None) }}" - + - name: Check status of node certificates + stat: + path: "{{ item }}" + with_items: + - "/etc/openshift/node/node.key" + - "/etc/openshift/node/node.kubeconfig" + - "/etc/openshift/node/ca.crt" + - "/etc/openshift/node/server.key" + register: stat_result + - set_fact: + certs_missing: "{{ stat_result.results | map(attribute='stat.exists') + | list | intersect([false])}}" + node_subdir: node-{{ openshift.common.hostname }} + config_dir: /etc/openshift/generated-configs/node-{{ openshift.common.hostname }} + node_cert_dir: /etc/openshift/node - name: Create temp directory for syncing certs hosts: localhost @@ -37,66 +50,57 @@ register: mktemp changed_when: False - - name: Register nodes hosts: oo_first_master vars: - openshift_nodes: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']) }}" + nodes_needing_certs: "{{ hostvars + | oo_select_keys(groups['oo_nodes_to_config']) + | oo_filter_list(filter_attr='certs_missing') }}" + openshift_nodes: "{{ hostvars + | oo_select_keys(groups['oo_nodes_to_config']) }}" sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}" roles: - openshift_register_nodes - tasks: - # TODO: update so that we only sync necessary configs/directories, currently - # we sync for all nodes in oo_nodes_to_config. We will need to inspect the - # configs on the nodes to make the determination on whether to sync or not. - - name: Create the temp directory on the master - file: - path: "{{ sync_tmpdir }}" - owner: "{{ ansible_ssh_user }}" - mode: 0700 - state: directory - changed_when: False - + post_tasks: - name: Create a tarball of the node config directories - command: tar -czvf {{ sync_tmpdir }}/{{ item.openshift.common.hostname }}.tgz ./ + command: > + tar -czvf {{ item.config_dir }}.tgz ./ + --transform 's|system:{{ item.node_subdir }}|node|' + -C {{ item.config_dir }} . args: - chdir: "{{ openshift_generated_configs_dir }}/node-{{ item.openshift.common.hostname }}" - with_items: openshift_nodes - changed_when: False + creates: "{{ item.config_dir }}.tgz" + with_items: nodes_needing_certs - name: Retrieve the node config tarballs from the master fetch: - src: "{{ sync_tmpdir }}/{{ item.openshift.common.hostname }}.tgz" + src: "{{ item.config_dir }}.tgz" dest: "{{ sync_tmpdir }}/" + flat: yes fail_on_missing: yes validate_checksum: yes - with_items: openshift_nodes - changed_when: False - + with_items: nodes_needing_certs - name: Configure node instances hosts: oo_nodes_to_config - gather_facts: no vars: - sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}/{{ groups['oo_first_master'][0] }}/{{ hostvars.localhost.mktemp.stdout }}" - openshift_sdn_master_url: "https://{{ hostvars[groups['oo_first_master'][0]].openshift.common.hostname }}:4001" + sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}" + openshift_node_master_api_url: "{{ hostvars[openshift_first_master].openshift.master.api_url }}" pre_tasks: - name: Ensure certificate directory exists file: - path: "{{ openshift_node_cert_dir }}" + path: "{{ node_cert_dir }}" state: directory - # TODO: notify restart openshift-node and/or restart openshift-sdn-node, + # TODO: notify restart openshift-node # possibly test service started time against certificate/config file - # timestamps in openshift-node or openshift-sdn-node to trigger notify + # timestamps in openshift-node to trigger notify - name: Unarchive the tarball on the node unarchive: - src: "{{ sync_tmpdir }}/{{ openshift.common.hostname }}.tgz" - dest: "{{ openshift_node_cert_dir }}" + src: "{{ sync_tmpdir }}/{{ node_subdir }}.tgz" + dest: "{{ node_cert_dir }}" + when: certs_missing roles: - openshift_node - - role: openshift_sdn_node - when: openshift.common.use_openshift_sdn | bool - role: fluentd_node when: openshift.common.use_fluentd | bool tasks: @@ -113,7 +117,6 @@ - file: name={{ sync_tmpdir }} state=absent changed_when: False - - name: Delete temporary directory on localhost hosts: localhost connection: local @@ -123,7 +126,6 @@ - file: name={{ mktemp.stdout }} state=absent changed_when: False - # Additional config for online type deployments - name: Additional instance config hosts: oo_nodes_deployment_type_online -- cgit v1.2.3 From 5176446e148679e7a75119a1bfe9088262365ff9 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 4 Jun 2015 14:34:27 -0400 Subject: Bugfixes - Don't include ./ in the tarball we transfer to the nodes - Fixup node argument ordering --- playbooks/common/openshift-node/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index a650796c7..9e642f3d3 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -64,7 +64,7 @@ post_tasks: - name: Create a tarball of the node config directories command: > - tar -czvf {{ item.config_dir }}.tgz ./ + tar -czvf {{ item.config_dir }}.tgz --transform 's|system:{{ item.node_subdir }}|node|' -C {{ item.config_dir }} . args: -- cgit v1.2.3