From 9199379f94f6b11a4841e31f6c58a11c1e9f8c3a Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 13 Mar 2015 03:58:23 -0400 Subject: Various fixes - playbooks/gce/openshift-cluster: - Remove some stray debugging statements - Some minor formatting fixes - removing un-necessary quotes - cleaning up some jinja templates for readability - add a play to the launch playbook to apply the os_update_latest role on all hosts in the new environment - improve setting groups and gce_public_ip when using add_host module - set gce_public_ip as a variable for the host using the returned gce instance_data - add a group for each tag configured on the host (pre-pending tag_ to the tag name) - update the openshift-master/config.yml and openshift-node/config.yml includes to use the tag_env-host-type groups - openshift-{master,node}/config.yml - Some cleanup - remove some extraneous quotes - remove connection: ssh from remote hosts, since it is the default - remove user: root and instead set ansible_ssh_user in inventory/gce/group_vars/all - set openshift_public_ip and openshift_env to templated values in inventory/gce/group_vars/all as well - no longer set openshift_node_ips for the master host, since nodes will register themselves now when they are configured (prevent reboot on adding nodes) - move setting openshift_master_ips and openshift_public_master_ips using set_fact and instead use the vars: of the 'Configure Instances' play --- inventory/gce/group_vars/all | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 inventory/gce/group_vars/all (limited to 'inventory') diff --git a/inventory/gce/group_vars/all b/inventory/gce/group_vars/all new file mode 100644 index 000000000..4cd94c509 --- /dev/null +++ b/inventory/gce/group_vars/all @@ -0,0 +1,4 @@ +--- +ansible_ssh_user: root +openshift_public_ip: "{{ gce_public_ip }}" +openshift_env: "{{ oo_env }}" -- cgit v1.2.3 From 01ee65e99d39265f7d8db3ddbeca5d59ddfa2038 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Mon, 23 Mar 2015 23:37:19 -0400 Subject: gce inventory/playbook updates for node registration changes --- inventory/gce/group_vars/all | 3 +++ inventory/gce/group_vars/tag_host-type-master | 5 +++++ inventory/gce/group_vars/tag_host-type-node | 6 ++++++ inventory/gce/group_vars/tag_host-type-openshift-master | 1 + inventory/gce/group_vars/tag_host-type-openshift-node | 1 + 5 files changed, 16 insertions(+) create mode 100644 inventory/gce/group_vars/tag_host-type-master create mode 100644 inventory/gce/group_vars/tag_host-type-node create mode 120000 inventory/gce/group_vars/tag_host-type-openshift-master create mode 120000 inventory/gce/group_vars/tag_host-type-openshift-node (limited to 'inventory') diff --git a/inventory/gce/group_vars/all b/inventory/gce/group_vars/all index 4cd94c509..3e969df63 100644 --- a/inventory/gce/group_vars/all +++ b/inventory/gce/group_vars/all @@ -1,4 +1,7 @@ --- ansible_ssh_user: root +openshift_hostname: "{{ ansible_default_ipv4.address }}" +openshift_public_hostname: "{{ ansible_default_ipv4.address }}" +openshift_ip: "{{ ansible_default_ipv4.address }}" openshift_public_ip: "{{ gce_public_ip }}" openshift_env: "{{ oo_env }}" diff --git a/inventory/gce/group_vars/tag_host-type-master b/inventory/gce/group_vars/tag_host-type-master new file mode 100644 index 000000000..ddbdc650c --- /dev/null +++ b/inventory/gce/group_vars/tag_host-type-master @@ -0,0 +1,5 @@ +--- +openshift_api_url: https://{{ openshift_hostname }}:8443 +openshift_api_public_url: https://{{ openshift_public_hostname }}:8443 +openshift_webui_url: https://{{ openshift_hostname }}:8444 +openshift_webui_public_url: https://{{ openshift_public_hostname }}:8444 diff --git a/inventory/gce/group_vars/tag_host-type-node b/inventory/gce/group_vars/tag_host-type-node new file mode 100644 index 000000000..bb95a724d --- /dev/null +++ b/inventory/gce/group_vars/tag_host-type-node @@ -0,0 +1,6 @@ +--- +openshift_node_cpu: +openshift_node_memory: +openshift_node_pod_cidr: +openshift_node_labels: {} +openshift_node_annotations: {} diff --git a/inventory/gce/group_vars/tag_host-type-openshift-master b/inventory/gce/group_vars/tag_host-type-openshift-master new file mode 120000 index 000000000..c0c4cf370 --- /dev/null +++ b/inventory/gce/group_vars/tag_host-type-openshift-master @@ -0,0 +1 @@ +tag_host-type-master \ No newline at end of file diff --git a/inventory/gce/group_vars/tag_host-type-openshift-node b/inventory/gce/group_vars/tag_host-type-openshift-node new file mode 120000 index 000000000..ebbce6136 --- /dev/null +++ b/inventory/gce/group_vars/tag_host-type-openshift-node @@ -0,0 +1 @@ +tag_host-type-node \ No newline at end of file -- cgit v1.2.3 From 96729907e131f0cef6f37bcca062e9b092e67d29 Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Tue, 24 Mar 2015 13:15:53 -0400 Subject: Added spec files and tito configs. --- inventory/openshift-ansible-inventory.spec | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 inventory/openshift-ansible-inventory.spec (limited to 'inventory') diff --git a/inventory/openshift-ansible-inventory.spec b/inventory/openshift-ansible-inventory.spec new file mode 100644 index 000000000..156b81b86 --- /dev/null +++ b/inventory/openshift-ansible-inventory.spec @@ -0,0 +1,37 @@ +Summary: OpenShift Ansible Inventories +Name: openshift-ansible-inventory +Version: 0.0.0 +Release: 1%{?dist} +License: ASL 2.0 +URL: https://github.com/openshift/openshift-ansible +Source0: %{name}-%{version}.tar.gz +Requires: python2 +BuildRequires: python2-devel +BuildArch: noarch + +%description +Ansible Inventories used with the openshift-ansible scripts and playbooks. + +%prep +%setup -q + +%build + +%install +mkdir -p %{buildroot}/usr/share/ansible/inventory +mkdir -p %{buildroot}/usr/share/ansible/inventory/aws +mkdir -p %{buildroot}/usr/share/ansible/inventory/gce + +cp -p multi_ec2.py multi_ec2.yaml.example %{buildroot}/usr/share/ansible/inventory +cp -p aws/ec2.py aws/ec2.ini %{buildroot}/usr/share/ansible/inventory/aws +cp -p gce/gce.py %{buildroot}/usr/share/ansible/inventory/gce + +%files +%dir /usr/share/ansible/inventory +/usr/share/ansible/inventory/multi_ec2.py* +/usr/share/ansible/inventory/multi_ec2.yaml.example +/usr/share/ansible/inventory/aws/ec2.py* +%config(noreplace) /usr/share/ansible/inventory/aws/ec2.ini +/usr/share/ansible/inventory/gce/gce.py* + +%changelog -- cgit v1.2.3 From 43ed89371aa2fce56d5e2b41af35a3ae902e92e6 Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Tue, 24 Mar 2015 16:19:46 -0400 Subject: Automatic commit of package [openshift-ansible-inventory] release [0.0.1-1]. --- inventory/openshift-ansible-inventory.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inventory') diff --git a/inventory/openshift-ansible-inventory.spec b/inventory/openshift-ansible-inventory.spec index 156b81b86..e847df189 100644 --- a/inventory/openshift-ansible-inventory.spec +++ b/inventory/openshift-ansible-inventory.spec @@ -1,6 +1,6 @@ Summary: OpenShift Ansible Inventories Name: openshift-ansible-inventory -Version: 0.0.0 +Version: 0.0.1 Release: 1%{?dist} License: ASL 2.0 URL: https://github.com/openshift/openshift-ansible @@ -35,3 +35,6 @@ cp -p gce/gce.py %{buildroot}/usr/share/ansible/inventory/gce /usr/share/ansible/inventory/gce/gce.py* %changelog +* Tue Mar 24 2015 Thomas Wiest 0.0.1-1 +- new package built with tito + -- cgit v1.2.3 From f79f6d649a4c8599121d9cad5492afc579f0425a Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Wed, 25 Mar 2015 16:45:50 -0400 Subject: added the ability to have a config file in /etc/openshift_ansible to multi_ec2.py. --- inventory/multi_ec2.py | 17 +++++++++++++++-- inventory/openshift-ansible-inventory.spec | 6 ++++-- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'inventory') diff --git a/inventory/multi_ec2.py b/inventory/multi_ec2.py index 5dee7972b..26c09d712 100755 --- a/inventory/multi_ec2.py +++ b/inventory/multi_ec2.py @@ -12,6 +12,8 @@ import json import pprint +CONFIG_FILE_NAME = 'multi_ec2.yaml' + class MultiEc2(object): def __init__(self): @@ -20,11 +22,22 @@ class MultiEc2(object): self.result = {} self.cache_path = os.path.expanduser('~/.ansible/tmp/multi_ec2_inventory.cache') self.file_path = os.path.join(os.path.dirname(os.path.realpath(__file__))) - self.config_file = os.path.join(self.file_path,"multi_ec2.yaml") + + same_dir_config_file = os.path.join(self.file_path, CONFIG_FILE_NAME) + etc_dir_config_file = os.path.join(os.path.sep, 'etc','ansible', CONFIG_FILE_NAME) + + # Prefer a file in the same directory, fall back to a file in etc + if os.path.isfile(same_dir_config_file): + self.config_file = same_dir_config_file + elif os.path.isfile(etc_dir_config_file): + self.config_file = etc_dir_config_file + else: + self.config_file = None # expect env vars + self.parse_cli_args() # load yaml - if os.path.isfile(self.config_file): + if self.config_file and os.path.isfile(self.config_file): self.config = self.load_yaml_config() elif os.environ.has_key("AWS_ACCESS_KEY_ID") and os.environ.has_key("AWS_SECRET_ACCESS_KEY"): self.config = {} diff --git a/inventory/openshift-ansible-inventory.spec b/inventory/openshift-ansible-inventory.spec index e847df189..9b721818e 100644 --- a/inventory/openshift-ansible-inventory.spec +++ b/inventory/openshift-ansible-inventory.spec @@ -18,18 +18,20 @@ Ansible Inventories used with the openshift-ansible scripts and playbooks. %build %install +mkdir -p %{buildroot}/etc/ansible mkdir -p %{buildroot}/usr/share/ansible/inventory mkdir -p %{buildroot}/usr/share/ansible/inventory/aws mkdir -p %{buildroot}/usr/share/ansible/inventory/gce -cp -p multi_ec2.py multi_ec2.yaml.example %{buildroot}/usr/share/ansible/inventory +cp -p multi_ec2.py %{buildroot}/usr/share/ansible/inventory +cp -p multi_ec2.yaml.example %{buildroot}/etc/ansible/multi_ec2.yaml cp -p aws/ec2.py aws/ec2.ini %{buildroot}/usr/share/ansible/inventory/aws cp -p gce/gce.py %{buildroot}/usr/share/ansible/inventory/gce %files +%config(noreplace) /etc/ansible/* %dir /usr/share/ansible/inventory /usr/share/ansible/inventory/multi_ec2.py* -/usr/share/ansible/inventory/multi_ec2.yaml.example /usr/share/ansible/inventory/aws/ec2.py* %config(noreplace) /usr/share/ansible/inventory/aws/ec2.ini /usr/share/ansible/inventory/gce/gce.py* -- cgit v1.2.3 From 78a45fc50509eca27164452325529cc46a99cc8c Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Thu, 26 Mar 2015 11:14:30 -0400 Subject: Automatic commit of package [openshift-ansible-inventory] release [0.0.2-1]. --- inventory/openshift-ansible-inventory.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'inventory') diff --git a/inventory/openshift-ansible-inventory.spec b/inventory/openshift-ansible-inventory.spec index 9b721818e..8267e16f6 100644 --- a/inventory/openshift-ansible-inventory.spec +++ b/inventory/openshift-ansible-inventory.spec @@ -1,6 +1,6 @@ Summary: OpenShift Ansible Inventories Name: openshift-ansible-inventory -Version: 0.0.1 +Version: 0.0.2 Release: 1%{?dist} License: ASL 2.0 URL: https://github.com/openshift/openshift-ansible @@ -37,6 +37,14 @@ cp -p gce/gce.py %{buildroot}/usr/share/ansible/inventory/gce /usr/share/ansible/inventory/gce/gce.py* %changelog +* Thu Mar 26 2015 Thomas Wiest 0.0.2-1 +- added the ability to have a config file in /etc/openshift_ansible to + multi_ec2.py. (twiest@redhat.com) +- Merge pull request #97 from jwhonce/wip/cluster (jhonce@redhat.com) +- gce inventory/playbook updates for node registration changes + (jdetiber@redhat.com) +- Various fixes (jdetiber@redhat.com) + * Tue Mar 24 2015 Thomas Wiest 0.0.1-1 - new package built with tito -- cgit v1.2.3 From 4712e72c912a1102bff0508c98bd97da3f33ae95 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Mon, 23 Mar 2015 23:53:17 -0400 Subject: openshift_facts role/module refactor default settings - Add openshift_facts role and module - Created new role openshift_facts that contains an openshift_facts module - Refactor openshift_* roles to use openshift_facts instead of relying on defaults - Refactor playbooks to use openshift_facts - Cleanup inventory group_vars - Update defaults - update openshift_master role firewall defaults - remove etcd peer port, since we will not be supporting clustered embedded etcd - remove 8444 since console now runs on the api port by default - add 8444 and 7001 to disabled services to ensure removal if updating - Add new role os_env_extras_node that is a subset of the docker role - previously, we were starting/enabling docker which was causing issues with some installations - Does not install or start docker, since the openshift-node role will handle that for us - Only adds root to the dockerroot group - Update playbooks to use ops_env_extras_node role instead of docker role - os_firewall bug fixes - ignore ip6tables for now, since we are not configuring any ipv6 rules - if installing package do a daemon-reload before starting/enabling service - Add aws support to bin/cluster - Add list action to bin/cluster - Add update action to bin/cluster - cleanup some stray debug statements - some variable renaming for clarity --- inventory/aws/group_vars/all | 2 ++ inventory/gce/group_vars/all | 5 ----- inventory/gce/group_vars/tag_host-type-master | 5 ----- inventory/gce/group_vars/tag_host-type-node | 6 ------ inventory/gce/group_vars/tag_host-type-openshift-master | 1 - inventory/gce/group_vars/tag_host-type-openshift-node | 1 - 6 files changed, 2 insertions(+), 18 deletions(-) create mode 100644 inventory/aws/group_vars/all delete mode 100644 inventory/gce/group_vars/tag_host-type-master delete mode 100644 inventory/gce/group_vars/tag_host-type-node delete mode 120000 inventory/gce/group_vars/tag_host-type-openshift-master delete mode 120000 inventory/gce/group_vars/tag_host-type-openshift-node (limited to 'inventory') diff --git a/inventory/aws/group_vars/all b/inventory/aws/group_vars/all new file mode 100644 index 000000000..b22da00de --- /dev/null +++ b/inventory/aws/group_vars/all @@ -0,0 +1,2 @@ +--- +ansible_ssh_user: root diff --git a/inventory/gce/group_vars/all b/inventory/gce/group_vars/all index 3e969df63..b22da00de 100644 --- a/inventory/gce/group_vars/all +++ b/inventory/gce/group_vars/all @@ -1,7 +1,2 @@ --- ansible_ssh_user: root -openshift_hostname: "{{ ansible_default_ipv4.address }}" -openshift_public_hostname: "{{ ansible_default_ipv4.address }}" -openshift_ip: "{{ ansible_default_ipv4.address }}" -openshift_public_ip: "{{ gce_public_ip }}" -openshift_env: "{{ oo_env }}" diff --git a/inventory/gce/group_vars/tag_host-type-master b/inventory/gce/group_vars/tag_host-type-master deleted file mode 100644 index ddbdc650c..000000000 --- a/inventory/gce/group_vars/tag_host-type-master +++ /dev/null @@ -1,5 +0,0 @@ ---- -openshift_api_url: https://{{ openshift_hostname }}:8443 -openshift_api_public_url: https://{{ openshift_public_hostname }}:8443 -openshift_webui_url: https://{{ openshift_hostname }}:8444 -openshift_webui_public_url: https://{{ openshift_public_hostname }}:8444 diff --git a/inventory/gce/group_vars/tag_host-type-node b/inventory/gce/group_vars/tag_host-type-node deleted file mode 100644 index bb95a724d..000000000 --- a/inventory/gce/group_vars/tag_host-type-node +++ /dev/null @@ -1,6 +0,0 @@ ---- -openshift_node_cpu: -openshift_node_memory: -openshift_node_pod_cidr: -openshift_node_labels: {} -openshift_node_annotations: {} diff --git a/inventory/gce/group_vars/tag_host-type-openshift-master b/inventory/gce/group_vars/tag_host-type-openshift-master deleted file mode 120000 index c0c4cf370..000000000 --- a/inventory/gce/group_vars/tag_host-type-openshift-master +++ /dev/null @@ -1 +0,0 @@ -tag_host-type-master \ No newline at end of file diff --git a/inventory/gce/group_vars/tag_host-type-openshift-node b/inventory/gce/group_vars/tag_host-type-openshift-node deleted file mode 120000 index ebbce6136..000000000 --- a/inventory/gce/group_vars/tag_host-type-openshift-node +++ /dev/null @@ -1 +0,0 @@ -tag_host-type-node \ No newline at end of file -- cgit v1.2.3 From 8a4888ad30ce7c5898caac47614da2e13a759320 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Sun, 1 Mar 2015 00:27:04 -0500 Subject: Add byo playbooks and enterprise docs - added byo playbooks - added byo (example) inventory - added a README_OSE.md for getting started with Enterprise deployments - Added an ansible.cfg as an example for configuration helpful for playbooks/roles --- inventory/byo/group_vars/all | 28 ++++++++++++++++++++++++++++ inventory/byo/hosts | 10 ++++++++++ 2 files changed, 38 insertions(+) create mode 100644 inventory/byo/group_vars/all create mode 100644 inventory/byo/hosts (limited to 'inventory') diff --git a/inventory/byo/group_vars/all b/inventory/byo/group_vars/all new file mode 100644 index 000000000..d63e96668 --- /dev/null +++ b/inventory/byo/group_vars/all @@ -0,0 +1,28 @@ +--- +# lets assume that we want to use the root as the ssh user for all hosts +ansible_ssh_user: root + +# default debug level for all OpenShift hosts +openshift_debug_level: 4 + +# set the OpenShift deployment type for all hosts +openshift_deployment_type: enterprise + +# Override the default registry for development +openshift_registry_url: docker-buildvm-rhose.usersys.redhat.com:5000/openshift3_beta/ose-${component}:${version} + +# Use latest Errata puddle as an additional repo: +#openshift_additional_repos: +#- id: ose-devel +# name: ose-devel +# baseurl: http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterpriseErrata/3.0/latest/RH7-RHOSE-3.0/$basearch/os +# enabled: 1 +# gpgcheck: 0 + +# Use latest Whitelist puddle as an additional repo: +openshift_additional_repos: +- id: ose-devel + name: ose-devel + baseurl: http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/3.0/latest/RH7-RHOSE-3.0/$basearch/os + enabled: 1 + gpgcheck: 0 diff --git a/inventory/byo/hosts b/inventory/byo/hosts new file mode 100644 index 000000000..2dd854778 --- /dev/null +++ b/inventory/byo/hosts @@ -0,0 +1,10 @@ +# This is an example of a bring your own (byo) host inventory + +# host group for masters +[masters] +ose3-master-ansible.test.example.com + +# host group for nodes +[nodes] +ose3-node[1:2]-ansible.test.example.com + -- cgit v1.2.3 From 9fbec064d28a72963b1566258b4bcabcd63b2c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Wed, 8 Apr 2015 16:33:55 +0200 Subject: Add libvirt as a provider --- inventory/libvirt/group_vars/all | 2 ++ inventory/libvirt/hosts | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 inventory/libvirt/group_vars/all create mode 100644 inventory/libvirt/hosts (limited to 'inventory') diff --git a/inventory/libvirt/group_vars/all b/inventory/libvirt/group_vars/all new file mode 100644 index 000000000..b22da00de --- /dev/null +++ b/inventory/libvirt/group_vars/all @@ -0,0 +1,2 @@ +--- +ansible_ssh_user: root diff --git a/inventory/libvirt/hosts b/inventory/libvirt/hosts new file mode 100644 index 000000000..6a818f268 --- /dev/null +++ b/inventory/libvirt/hosts @@ -0,0 +1,2 @@ +# Eventually we'll add the GCE, AWS, etc dynamic inventories, but for now... +localhost ansible_python_interpreter=/usr/bin/python2 -- cgit v1.2.3