diff options
Diffstat (limited to 'inventory')
-rw-r--r-- | inventory/aws/group_vars/all | 2 | ||||
-rw-r--r-- | inventory/byo/group_vars/all | 28 | ||||
-rw-r--r-- | inventory/byo/hosts | 10 | ||||
-rw-r--r-- | inventory/gce/group_vars/all | 2 | ||||
-rw-r--r-- | inventory/libvirt/group_vars/all | 2 | ||||
-rw-r--r-- | inventory/libvirt/hosts | 2 | ||||
-rwxr-xr-x | inventory/multi_ec2.py | 17 | ||||
-rw-r--r-- | inventory/openshift-ansible-inventory.spec | 50 |
8 files changed, 111 insertions, 2 deletions
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/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 + diff --git a/inventory/gce/group_vars/all b/inventory/gce/group_vars/all new file mode 100644 index 000000000..b22da00de --- /dev/null +++ b/inventory/gce/group_vars/all @@ -0,0 +1,2 @@ +--- +ansible_ssh_user: root 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 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 new file mode 100644 index 000000000..8267e16f6 --- /dev/null +++ b/inventory/openshift-ansible-inventory.spec @@ -0,0 +1,50 @@ +Summary: OpenShift Ansible Inventories +Name: openshift-ansible-inventory +Version: 0.0.2 +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}/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 %{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/aws/ec2.py* +%config(noreplace) /usr/share/ansible/inventory/aws/ec2.ini +/usr/share/ansible/inventory/gce/gce.py* + +%changelog +* Thu Mar 26 2015 Thomas Wiest <twiest@redhat.com> 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 <twiest@redhat.com> 0.0.1-1 +- new package built with tito + |