diff options
-rw-r--r-- | .tito/packages/openshift-ansible | 2 | ||||
-rwxr-xr-x | bin/ohi | 6 | ||||
-rw-r--r-- | bin/openshift_ansible/awsutil.py | 12 | ||||
-rwxr-xr-x | bin/opscp | 46 | ||||
-rwxr-xr-x | bin/opssh | 4 | ||||
-rw-r--r-- | openshift-ansible.spec | 36 | ||||
-rw-r--r-- | playbooks/common/openshift-cluster/update_repos_and_packages.yml | 1 | ||||
-rw-r--r-- | playbooks/openstack/openshift-cluster/launch.yml | 3 | ||||
-rw-r--r-- | playbooks/openstack/openshift-cluster/terminate.yml | 2 | ||||
-rw-r--r-- | roles/rhel_subscribe/meta/main.yml | 2 | ||||
-rw-r--r-- | roles/rhel_subscribe/tasks/main.yml | 3 |
11 files changed, 95 insertions, 22 deletions
diff --git a/.tito/packages/openshift-ansible b/.tito/packages/openshift-ansible index ead513c3d..e3f5491cd 100644 --- a/.tito/packages/openshift-ansible +++ b/.tito/packages/openshift-ansible @@ -1 +1 @@ -3.0.36-1 ./ +3.0.37-1 ./ @@ -65,6 +65,9 @@ class Ohi(object): # We weren't able to determine what they wanted to do raise ArgumentError("Invalid combination of arguments") + if self.args.ip: + hosts = self.aws.convert_to_ip(hosts) + for host in sorted(hosts, key=utils.normalize_dnsname): if self.args.user: print "%s@%s" % (self.args.user, host) @@ -112,6 +115,9 @@ class Ohi(object): parser.add_argument('--v3', action='store_true', default=False, help='Specify the openshift version.') + parser.add_argument('--ip', action='store_true', default=False, + help='Return ip address only.') + parser.add_argument('--all-versions', action='store_true', default=False, help='Specify the openshift version. Return all versions') diff --git a/bin/openshift_ansible/awsutil.py b/bin/openshift_ansible/awsutil.py index 3639ef733..945e6a20c 100644 --- a/bin/openshift_ansible/awsutil.py +++ b/bin/openshift_ansible/awsutil.py @@ -232,4 +232,14 @@ class AwsUtil(object): if version != 'all': retval.intersection_update(inv.get(AwsUtil.gen_version_tag(version), [])) - return retval + return list(retval) + + def convert_to_ip(self, hosts, cached=False): + """convert a list of host names to ip addresses""" + + inv = self.get_inventory(cached=cached) + ips = [] + for host in hosts: + ips.append(inv['_meta']['hostvars'][host]['oo_public_ip']) + + return ips @@ -13,7 +13,10 @@ Options: -p PAR, --par=PAR max number of parallel threads (OPTIONAL) --outdir=OUTDIR output directory for stdout files (OPTIONAL) --errdir=ERRDIR output directory for stderr files (OPTIONAL) + -c CLUSTER, --cluster CLUSTER + which cluster to use -e ENV, --env ENV which environment to use + --v3 When working with v3 environments. v2 by default -t HOST_TYPE, --host-type HOST_TYPE which host type to use --list-host-types list all of the host types @@ -61,12 +64,23 @@ while [ $# -gt 0 ] ; do shift # get past the value of the option ;; + -c) + shift # get past the option + CLUSTER=$1 + shift # get past the value of the option + ;; + -e) shift # get past the option ENV=$1 shift # get past the value of the option ;; + --v3) + OPENSHIFT_VERSION="--v3 --ip" + shift # get past the value of the option + ;; + --timeout) shift # get past the option TIMEOUT=$1 @@ -103,20 +117,26 @@ while [ $# -gt 0 ] ; do done # Get host list from ohi -if [ -n "$ENV" -a -n "$HOST_TYPE" ] ; then - HOSTS="$(ohi -t "$HOST_TYPE" -e "$ENV" 2>/dev/null)" - OHI_ECODE=$? -elif [ -n "$ENV" ] ; then - HOSTS="$(ohi -e "$ENV" 2>/dev/null)" - OHI_ECODE=$? -elif [ -n "$HOST_TYPE" ] ; then - HOSTS="$(ohi -t "$HOST_TYPE" 2>/dev/null)" +CMD="" +if [ -n "$CLUSTER" ] ; then + CMD="$CMD -c $CLUSTER" +fi + +if [ -n "$ENV" ] ; then + CMD="$CMD -e $ENV" +fi + +if [ -n "$HOST_TYPE" ] ; then + CMD="$CMD -t $HOST_TYPE" +fi + +if [ -n "$OPENSHIFT_VERSION" ] ; then + CMD="$CMD $OPENSHIFT_VERSION" +fi + +if [ -n "$CMD" ] ; then + HOSTS="$(ohi $CMD 2>/dev/null)" OHI_ECODE=$? -else - echo - echo "Error: either -e or -t must be specified" - echo - exit 10 fi if [ $OHI_ECODE -ne 0 ] ; then @@ -56,9 +56,9 @@ fi PAR=200 USER=root TIMEOUT=0 -ARGS=() ENV="" HOST_TYPE="" + while [ $# -gt 0 ] ; do case $1 in -t|--host-type) @@ -80,7 +80,7 @@ while [ $# -gt 0 ] ; do ;; --v3) - OPENSHIFT_VERSION="--v3" + OPENSHIFT_VERSION="--v3 --ip" shift # get past the value of the option ;; diff --git a/openshift-ansible.spec b/openshift-ansible.spec index 1a1445835..051a6d966 100644 --- a/openshift-ansible.spec +++ b/openshift-ansible.spec @@ -5,7 +5,7 @@ } Name: openshift-ansible -Version: 3.0.36 +Version: 3.0.37 Release: 1%{?dist} Summary: Openshift and Atomic Enterprise Ansible License: ASL 2.0 @@ -259,6 +259,40 @@ Atomic OpenShift Utilities includes %changelog +* Fri Jan 29 2016 Kenny Woodson <kwoodson@redhat.com> 3.0.37-1 +- Adding ip address option (kwoodson@redhat.com) +- Enable cockpit when not is_atomic. (abutcher@redhat.com) +- Explicitly restart the atomic node service after configuring it for nuage + (vishal.patil@nuagenetworks.net) +- Fix for bug 1298 (vishal.patil@nuagenetworks.net) +- fixing logic for skipping symlinks (kwoodson@redhat.com) +- Allow to have custom bucket name and region (florian.lambert@enovance.com) +- Add inventory example for logrotate_scripts (abutcher@redhat.com) +- Minor readme cleanup for Bug 1271566 (bleanhar@redhat.com) +- fix template trigger calc (jdiaz@redhat.com) +- Configure logrotate on atomic. (abutcher@redhat.com) +- Comparing zbx_host interfaces and removing duplicate hostgroup_names + (kwoodson@redhat.com) +- Dockerfile: Require pyOpenSSL (gscrivan@redhat.com) +- replace yum with dnf (spartacus06@gmail.com) +- Install cockpit, logrotate and fluentd unless host is atomic. + (abutcher@redhat.com) +- zabbix: added the skydns items and triggers (mwoodson@redhat.com) +- fix pkg_version (spinolacastro@gmail.com) +- Expose data_dir (spinolacastro@gmail.com) +- Fix checking for update package availability (nikolai@prokoschenko.de) +- Fix oo_pretty_print_cluster following the renaming of `env` into `clusterid` + (lhuard@amadeus.com) +- Ensure openssl present for etcd_ca (jdetiber@redhat.com) +- Update Docs and test for testing ansible version (jdetiber@redhat.com) +- Add Nuage support to openshift ansible (vishpat@gmail.com) +- Updating for host monitoring HA masters (kwoodson@redhat.com) +- adhoc s3 registry - add auth part in the registry config sample + (gael.lambert@enovance.com) +- Move the `is_atomic` check from `update_repos_and_packages.yml` to + `rhel_subscribe` (lhuard@amadeus.com) +- Increase OpenStack stack creation/deletion timeout (lhuard@amadeus.com) + * Mon Jan 25 2016 Kenny Woodson <kwoodson@redhat.com> 3.0.36-1 - Fixing awsutil to support aliases and v3 (kwoodson@redhat.com) - Fail when master restart playbook finds no active masters rather than any diff --git a/playbooks/common/openshift-cluster/update_repos_and_packages.yml b/playbooks/common/openshift-cluster/update_repos_and_packages.yml index 88736ee03..1474bb3ca 100644 --- a/playbooks/common/openshift-cluster/update_repos_and_packages.yml +++ b/playbooks/common/openshift-cluster/update_repos_and_packages.yml @@ -8,6 +8,5 @@ ansible_distribution == "RedHat" and lookup('oo_option', 'rhel_skip_subscription') | default(rhsub_skip, True) | default('no', True) | lower in ['no', 'false'] - and not openshift.common.is_atomic | bool - openshift_repos - os_update_latest diff --git a/playbooks/openstack/openshift-cluster/launch.yml b/playbooks/openstack/openshift-cluster/launch.yml index fdcb77acc..76cc64a73 100644 --- a/playbooks/openstack/openshift-cluster/launch.yml +++ b/playbooks/openstack/openshift-cluster/launch.yml @@ -29,6 +29,7 @@ - name: Create or Update OpenStack Stack command: 'heat {{ heat_stack_action }} -f {{ openstack_infra_heat_stack }} + --timeout 3 --enable-rollback -P cluster_env={{ cluster_env }} -P cluster_id={{ cluster_id }} -P cidr={{ openstack_network_cidr }} @@ -56,7 +57,7 @@ register: stack_show_status_result until: stack_show_status_result.stdout not in ['CREATE_IN_PROGRESS', 'UPDATE_IN_PROGRESS'] retries: 30 - delay: 1 + delay: 5 failed_when: stack_show_status_result.stdout not in ['CREATE_COMPLETE', 'UPDATE_COMPLETE'] - name: Read OpenStack Stack outputs diff --git a/playbooks/openstack/openshift-cluster/terminate.yml b/playbooks/openstack/openshift-cluster/terminate.yml index d4ab51fa7..7a86b78c5 100644 --- a/playbooks/openstack/openshift-cluster/terminate.yml +++ b/playbooks/openstack/openshift-cluster/terminate.yml @@ -43,6 +43,6 @@ register: stack_show_result until: stack_show_result.stdout != 'DELETE_IN_PROGRESS' retries: 60 - delay: 1 + delay: 5 failed_when: '"Stack not found" not in stack_show_result.stderr and stack_show_result.stdout != "DELETE_COMPLETE"' diff --git a/roles/rhel_subscribe/meta/main.yml b/roles/rhel_subscribe/meta/main.yml new file mode 100644 index 000000000..bbc3ad172 --- /dev/null +++ b/roles/rhel_subscribe/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - openshift_facts diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml index eecfd04a0..85e17ff9d 100644 --- a/roles/rhel_subscribe/tasks/main.yml +++ b/roles/rhel_subscribe/tasks/main.yml @@ -41,4 +41,5 @@ command: subscription-manager subscribe --pool {{ openshift_pool_id.stdout_lines[0] }} - include: enterprise.yml - when: deployment_type in [ 'enterprise', 'atomic-enterprise', 'openshift-enterprise' ] + when: deployment_type in [ 'enterprise', 'atomic-enterprise', 'openshift-enterprise' ] and + not openshift.common.is_atomic | bool |