summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--images/installer/Dockerfile9
-rw-r--r--images/installer/Dockerfile.rhel72
-rw-r--r--playbooks/container-runtime/private/config.yml2
-rw-r--r--playbooks/container-runtime/private/setup_storage.yml2
-rw-r--r--setup.py17
-rw-r--r--test/tox-inventory.txt105
-rw-r--r--test/tox-inventory.txt_extras3
-rw-r--r--tox.ini1
8 files changed, 123 insertions, 18 deletions
diff --git a/images/installer/Dockerfile b/images/installer/Dockerfile
index 0d977d48f..9a10ff257 100644
--- a/images/installer/Dockerfile
+++ b/images/installer/Dockerfile
@@ -10,7 +10,14 @@ COPY images/installer/origin-extra-root /
# install ansible and deps
RUN INSTALL_PKGS="python-lxml pyOpenSSL python2-cryptography openssl java-1.8.0-openjdk-headless python2-passlib httpd-tools openssh-clients origin-clients" \
&& yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS \
- && EPEL_PKGS="ansible python2-boto" \
+ && echo '[google-cloud-sdk]' > /etc/yum.repos.d/google-cloud-sdk.repo \
+ && echo 'baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64' >> /etc/yum.repos.d/google-cloud-sdk.repo \
+ && echo 'enabled=1' >> /etc/yum.repos.d/google-cloud-sdk.repo \
+ && echo 'gpgcheck=1' >> /etc/yum.repos.d/google-cloud-sdk.repo \
+ && echo 'repo_gpgcheck=1' >> /etc/yum.repos.d/google-cloud-sdk.repo \
+ && echo 'gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg' >> /etc/yum.repos.d/google-cloud-sdk.repo \
+ && echo ' https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg' >> /etc/yum.repos.d/google-cloud-sdk.repo \
+ && EPEL_PKGS="ansible python2-boto google-cloud-cdk" \
&& yum install -y epel-release \
&& yum install -y --setopt=tsflags=nodocs $EPEL_PKGS \
&& rpm -V $INSTALL_PKGS $EPEL_PKGS \
diff --git a/images/installer/Dockerfile.rhel7 b/images/installer/Dockerfile.rhel7
index 5245771d0..05df6b43a 100644
--- a/images/installer/Dockerfile.rhel7
+++ b/images/installer/Dockerfile.rhel7
@@ -5,7 +5,7 @@ MAINTAINER OpenShift Team <dev@lists.openshift.redhat.com>
USER root
# Playbooks, roles, and their dependencies are installed from packages.
-RUN INSTALL_PKGS="atomic-openshift-utils atomic-openshift-clients python-boto openssl java-1.8.0-openjdk-headless httpd-tools" \
+RUN INSTALL_PKGS="atomic-openshift-utils atomic-openshift-clients python-boto openssl java-1.8.0-openjdk-headless httpd-tools google-cloud-sdk" \
&& yum repolist > /dev/null \
&& yum-config-manager --enable rhel-7-server-ose-3.7-rpms \
&& yum-config-manager --enable rhel-7-server-rh-common-rpms \
diff --git a/playbooks/container-runtime/private/config.yml b/playbooks/container-runtime/private/config.yml
index 67445edeb..d8fc93710 100644
--- a/playbooks/container-runtime/private/config.yml
+++ b/playbooks/container-runtime/private/config.yml
@@ -1,7 +1,7 @@
---
- hosts: "{{ l_containerized_host_groups }}"
vars:
- l_chg_temp: "{{ openshift_containerized_host_groups | default([]) }}"
+ l_chg_temp: "{{ hostvars[groups['oo_first_master'][0]]['openshift_containerized_host_groups'] | default([]) }}"
l_containerized_host_groups: "{{ (['oo_nodes_to_config'] | union(l_chg_temp)) | join(':') }}"
# role: container_runtime is necessary here to bring role default variables
# into the play scope.
diff --git a/playbooks/container-runtime/private/setup_storage.yml b/playbooks/container-runtime/private/setup_storage.yml
index 97226d6b2..54fa5ca66 100644
--- a/playbooks/container-runtime/private/setup_storage.yml
+++ b/playbooks/container-runtime/private/setup_storage.yml
@@ -1,7 +1,7 @@
---
- hosts: "{{ l_containerized_host_groups }}"
vars:
- l_chg_temp: "{{ openshift_containerized_host_groups | default([]) }}"
+ l_chg_temp: "{{ hostvars[groups['oo_first_master'][0]]['openshift_containerized_host_groups'] | default([]) }}"
l_containerized_host_groups: "{{ (['oo_nodes_to_config'] | union(l_chg_temp)) | join(':') }}"
# role: container_runtime is necessary here to bring role default variables
# into the play scope.
diff --git a/setup.py b/setup.py
index 5ba050b83..f6b494858 100644
--- a/setup.py
+++ b/setup.py
@@ -348,21 +348,10 @@ class OpenShiftAnsibleSyntaxCheck(Command):
# --syntax-check each entry point playbook
try:
# Create a host group list to avoid WARNING on unmatched host patterns
- host_group_list = [
- 'etcd,masters,nodes,OSEv3',
- 'oo_all_hosts',
- 'oo_etcd_to_config,oo_new_etcd_to_config,oo_first_etcd,oo_etcd_hosts_to_backup,'
- 'oo_etcd_hosts_to_upgrade,oo_etcd_to_migrate',
- 'oo_masters,oo_masters_to_config,oo_first_master,oo_containerized_master_nodes',
- 'oo_nodes_to_config,oo_nodes_to_upgrade',
- 'oo_nodes_use_kuryr,oo_nodes_use_flannel',
- 'oo_nodes_use_calico,oo_nodes_use_nuage,oo_nodes_use_contiv',
- 'oo_lb_to_config',
- 'oo_nfs_to_config',
- 'glusterfs,glusterfs_registry,']
+ tox_ansible_inv = os.environ['TOX_ANSIBLE_INV_PATH']
subprocess.check_output(
- ['ansible-playbook', '-i ' + ','.join(host_group_list),
- '--syntax-check', playbook]
+ ['ansible-playbook', '-i', tox_ansible_inv,
+ '--syntax-check', playbook, '-e', '@{}_extras'.format(tox_ansible_inv)]
)
except subprocess.CalledProcessError as cpe:
print('{}Execution failed: {}{}'.format(
diff --git a/test/tox-inventory.txt b/test/tox-inventory.txt
new file mode 100644
index 000000000..6e57d224b
--- /dev/null
+++ b/test/tox-inventory.txt
@@ -0,0 +1,105 @@
+[OSEv3]
+localhost
+
+
+[OSEv3:children]
+etcd
+masters
+nodes
+oo_all_hosts
+oo_etcd_to_config
+oo_new_etcd_to_config
+oo_first_etcd
+oo_etcd_hosts_to_backup
+oo_etcd_hosts_to_upgrade
+oo_etcd_to_migrate
+oo_masters
+oo_masters_to_config
+oo_first_master
+oo_containerized_master_nodes
+oo_nodes_to_config
+oo_nodes_to_upgrade
+oo_nodes_use_kuryr
+oo_nodes_use_flannel
+oo_nodes_use_calico
+oo_nodes_use_nuage
+oo_nodes_use_contiv
+oo_lb_to_config
+oo_nfs_to_config
+glusterfs
+glusterfs_registry
+
+[etcd]
+localhost
+
+[masters]
+localhost
+
+[nodes]
+localhost
+
+[oo_all_hosts]
+localhost
+
+[oo_etcd_to_config]
+localhost
+
+[oo_new_etcd_to_config]
+localhost
+
+[oo_first_etcd]
+localhost
+
+[oo_etcd_hosts_to_backup]
+localhost
+
+[oo_etcd_hosts_to_upgrade]
+localhost
+
+[oo_etcd_to_migrate]
+localhost
+
+[oo_masters]
+localhost
+
+[oo_masters_to_config]
+localhost
+
+[oo_first_master]
+localhost
+
+[oo_containerized_master_nodes]
+localhost
+
+[oo_nodes_to_config]
+localhost
+
+[oo_nodes_to_upgrade]
+localhost
+
+[oo_nodes_use_kuryr]
+localhost
+
+[oo_nodes_use_flannel]
+localhost
+
+[oo_nodes_use_calico]
+localhost
+
+[oo_nodes_use_nuage]
+localhost
+
+[oo_nodes_use_contiv]
+localhost
+
+[oo_lb_to_config]
+localhost
+
+[oo_nfs_to_config]
+localhost
+
+[glusterfs]
+localhost
+
+[glusterfs_registry]
+localhost
diff --git a/test/tox-inventory.txt_extras b/test/tox-inventory.txt_extras
new file mode 100644
index 000000000..f73610570
--- /dev/null
+++ b/test/tox-inventory.txt_extras
@@ -0,0 +1,3 @@
+---
+hostvars:
+ localhost: {}
diff --git a/tox.ini b/tox.ini
index 9c35915d5..c11d12a58 100644
--- a/tox.ini
+++ b/tox.ini
@@ -8,6 +8,7 @@ skip_missing_interpreters=True
[testenv]
skip_install=True
+setenv = TOX_ANSIBLE_INV_PATH = {toxinidir}/test/tox-inventory.txt
deps =
-rrequirements.txt
-rtest-requirements.txt