diff options
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | README_AEP.md | 2 | ||||
| -rw-r--r-- | filter_plugins/oo_filters.py | 2 | ||||
| -rw-r--r-- | openshift-ansible.spec | 2 | ||||
| -rw-r--r-- | playbooks/aws/openshift-cluster/config.yml | 2 | ||||
| -rw-r--r-- | playbooks/byo/openshift-cluster/config.yml | 2 | ||||
| -rw-r--r-- | playbooks/common/openshift-cluster/evaluate_groups.yml | 2 | ||||
| -rw-r--r-- | playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml | 4 | ||||
| -rw-r--r-- | playbooks/gce/openshift-cluster/config.yml | 2 | ||||
| -rw-r--r-- | playbooks/libvirt/openshift-cluster/config.yml | 2 | ||||
| -rw-r--r-- | playbooks/openstack/openshift-cluster/config.yml | 2 | ||||
| -rw-r--r-- | roles/openshift_examples/tasks/main.yml | 43 | ||||
| -rw-r--r-- | roles/openshift_facts/tasks/main.yml | 6 | ||||
| -rw-r--r-- | roles/openshift_hosted/tasks/registry/storage/object_storage.yml | 6 | ||||
| l--------- | roles/openshift_hosted/tasks/registry/storage/registry_config.j2 | 1 | ||||
| l--------- | roles/openshift_hosted/tasks/registry/storage/registry_config_secret.j2 | 1 | ||||
| -rw-r--r-- | roles/openshift_hosted/tasks/router/router.yml | 11 | 
17 files changed, 69 insertions, 25 deletions
| @@ -11,11 +11,11 @@ they may in the future.  - Install base dependencies:    - Fedora:    ``` -    dnf install -y ansible-1.9.4 pyOpenSSL python-cryptography +    dnf install -y ansible-2.1.0.0 pyOpenSSL python-cryptography    ```     - OSX:    ``` -    # Install ansible 1.9.4 and python 2 +    # Install ansible 2.1.0.0 and python 2      brew install ansible python    ```  - Setup for a specific cloud: diff --git a/README_AEP.md b/README_AEP.md index 1b926f2ab..c588ebbd3 100644 --- a/README_AEP.md +++ b/README_AEP.md @@ -10,7 +10,7 @@  * [Overriding detected ip addresses and hostnames](#overriding-detected-ip-addresses-and-hostnames)  ## Requirements -* ansible 1.9.4 +* ansible 2.1.0.0    * Available in Fedora channels    * Available for EL with EPEL and Optional channel  * One or more RHEL 7.1 VMs diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index d706d0304..ec00a1646 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -660,7 +660,7 @@ class FilterModule(object):                          if kind == 'nfs':                              host = params['host']                              if host == None: -                                if len(groups['oo_nfs_to_config']) > 0: +                                if 'oo_nfs_to_config' in groups and len(groups['oo_nfs_to_config']) > 0:                                      host = groups['oo_nfs_to_config'][0]                                  else:                                      raise errors.AnsibleFilterError("|failed no storage host detected") diff --git a/openshift-ansible.spec b/openshift-ansible.spec index 822070e43..f70193367 100644 --- a/openshift-ansible.spec +++ b/openshift-ansible.spec @@ -13,7 +13,7 @@ URL:            https://github.com/openshift/openshift-ansible  Source0:        https://github.com/openshift/openshift-ansible/archive/%{commit}/%{name}-%{version}.tar.gz  BuildArch:      noarch -Requires:      ansible >= 1.9.4 +Requires:      ansible >= 2.1.0.0  Requires:      python2  Requires:      openshift-ansible-docs = %{version}-%{release} diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml index 71ce9e787..d6b5700b0 100644 --- a/playbooks/aws/openshift-cluster/config.yml +++ b/playbooks/aws/openshift-cluster/config.yml @@ -6,7 +6,7 @@    - add_host:        name: "{{ item }}"        groups: l_oo_all_hosts -    with_items: g_all_hosts +    with_items: "{{ g_all_hosts | default([]) }}"  - hosts: l_oo_all_hosts    gather_facts: no diff --git a/playbooks/byo/openshift-cluster/config.yml b/playbooks/byo/openshift-cluster/config.yml index c5479d098..3477b2dc4 100644 --- a/playbooks/byo/openshift-cluster/config.yml +++ b/playbooks/byo/openshift-cluster/config.yml @@ -8,7 +8,7 @@    - add_host:        name: "{{ item }}"        groups: l_oo_all_hosts -    with_items: g_all_hosts +    with_items: "{{ g_all_hosts | default([]) }}"  - hosts: l_oo_all_hosts    gather_facts: no diff --git a/playbooks/common/openshift-cluster/evaluate_groups.yml b/playbooks/common/openshift-cluster/evaluate_groups.yml index c5273b08f..3fb42a7fa 100644 --- a/playbooks/common/openshift-cluster/evaluate_groups.yml +++ b/playbooks/common/openshift-cluster/evaluate_groups.yml @@ -35,7 +35,7 @@        groups: oo_all_hosts        ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"        ansible_become: "{{ g_sudo | default(omit) }}" -    with_items: g_all_hosts | default([]) +    with_items: "{{ g_all_hosts | default([]) }}"    - name: Evaluate oo_masters      add_host: diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml index 0ea315d0a..59cedc839 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml @@ -84,10 +84,10 @@    # Only check if docker upgrade is required if docker_upgrade is not    # already set to False.    - include: ../docker/upgrade_check.yml -    when: docker_upgrade is not defined or docker_upgrade | bool +    when: docker_upgrade is not defined or docker_upgrade | bool and not openshift.common.is_atomic | bool    - include: ../docker/upgrade.yml -    when: l_docker_upgrade is defined and l_docker_upgrade | bool +    when: l_docker_upgrade is defined and l_docker_upgrade | bool and not openshift.common.is_atomic | bool    - include: rpm_upgrade.yml      vars: diff --git a/playbooks/gce/openshift-cluster/config.yml b/playbooks/gce/openshift-cluster/config.yml index 97572b930..8e46c5919 100644 --- a/playbooks/gce/openshift-cluster/config.yml +++ b/playbooks/gce/openshift-cluster/config.yml @@ -9,7 +9,7 @@        groups: l_oo_all_hosts        ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"        ansible_become: "{{ deployment_vars[deployment_type].become }}" -    with_items: g_all_hosts +    with_items: "{{ g_all_hosts | default([]) }}"  - hosts: l_oo_all_hosts    gather_facts: no diff --git a/playbooks/libvirt/openshift-cluster/config.yml b/playbooks/libvirt/openshift-cluster/config.yml index 21d82f422..a28e59a87 100644 --- a/playbooks/libvirt/openshift-cluster/config.yml +++ b/playbooks/libvirt/openshift-cluster/config.yml @@ -10,7 +10,7 @@    - add_host:        name: "{{ item }}"        groups: l_oo_all_hosts -    with_items: g_all_hosts +    with_items: "{{ g_all_hosts | default([]) }}"  - hosts: l_oo_all_hosts    gather_facts: no diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml index 6fff31826..1366c83ca 100644 --- a/playbooks/openstack/openshift-cluster/config.yml +++ b/playbooks/openstack/openshift-cluster/config.yml @@ -7,7 +7,7 @@    - add_host:        name: "{{ item }}"        groups: l_oo_all_hosts -    with_items: g_all_hosts +    with_items: "{{ g_all_hosts | default([]) }}"  - hosts: l_oo_all_hosts    gather_facts: no diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml index 7ea39f51e..8d2248578 100644 --- a/roles/openshift_examples/tasks/main.yml +++ b/roles/openshift_examples/tasks/main.yml @@ -1,9 +1,46 @@  --- -- name: Copy openshift examples -  copy: -    src: "examples/{{ content_version }}/" +###################################################################### +# Copying Examples +# +# We used to use the copy module to transfer the openshift examples to +# the remote. Then it started taking more than a minute to transfer +# the files. As noted in the module: +# +#   "The 'copy' module recursively copy facility does not scale to +#   lots (>hundreds) of files." +# +# The `synchronize` module is suggested as an alternative, we can't +# use it either due to changes introduced in Ansible 2.x. +- name: Create local temp dir for OpenShift examples copy +  local_action: command mktemp -d /tmp/openshift-ansible-XXXXXXX +  become: False +  register: copy_examples_mktemp +  run_once: True + +- name: Create tar of OpenShift examples +  local_action: command tar -C "{{ role_path }}/files/examples/{{ content_version }}/" -cvf "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar" . +  become: False +  register: copy_examples_tar + +- name: Create the remote OpenShift examples directory +  file: +    dest: "{{ examples_base }}" +    state: directory +    mode: 0755 + +- name: Unarchive the OpenShift examples on the remote +  unarchive: +    src: "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar"      dest: "{{ examples_base }}/" +- name: Cleanup the OpenShift Examples temp dir +  become: False +  local_action: file dest="{{ copy_examples_mktemp.stdout }}" state=absent + +# Done copying examples +###################################################################### +# Begin image streams +  - name: Modify registry paths if registry_url is not registry.access.redhat.com    shell: >      find {{ examples_base }} -type f | xargs -n 1 sed -i 's|registry.access.redhat.com|{{ registry_host | quote }}|g' diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml index c3723672d..2aca35ce1 100644 --- a/roles/openshift_facts/tasks/main.yml +++ b/roles/openshift_facts/tasks/main.yml @@ -1,8 +1,8 @@  --- -- name: Verify Ansible version is greater than or equal to 1.9.4 +- name: Verify Ansible version is greater than or equal to 2.1.0.0    fail: -    msg: "Unsupported ansible version: {{ ansible_version }} found" -  when: not ansible_version.full | version_compare('1.9.4', 'ge') +    msg: "Unsupported ansible version: {{ ansible_version.full }} found" +  when: not ansible_version.full | version_compare('2.1.0.0', 'ge')  - name: Detecting Operating System    stat: diff --git a/roles/openshift_hosted/tasks/registry/storage/object_storage.yml b/roles/openshift_hosted/tasks/registry/storage/object_storage.yml index 9db67ecc6..7b1b3f6ff 100644 --- a/roles/openshift_hosted/tasks/registry/storage/object_storage.yml +++ b/roles/openshift_hosted/tasks/registry/storage/object_storage.yml @@ -24,10 +24,10 @@    failed_when: false  - set_fact: -    registry_config: "{{ lookup('template', '../templates/registry_config.j2') | b64encode }}" +    registry_config: "{{ lookup('template', 'registry_config.j2') | b64encode }}"  - set_fact: -    registry_config_secret: "{{ lookup('template', '../templates/registry_config_secret.j2') | from_yaml }}" +    registry_config_secret: "{{ lookup('template', 'registry_config_secret.j2') | from_yaml }}"  - set_fact:      same_storage_provider: "{{ (secrets.stdout|from_json)['metadata']['annotations']['provider'] | default(none) == openshift.hosted.registry.storage.provider }}" @@ -111,4 +111,4 @@      --config={{ openshift_hosted_kubeconfig }}      --namespace={{ openshift.hosted.registry.namespace | default('default') }}      deploy dc/docker-registry --latest -  when: secrets.rc == 0 and update_config_secret.rc == 0 and same_storage_provider | bool +  when: secrets.rc == 0 and not update_config_secret | skipped and update_config_secret.rc == 0 and same_storage_provider | bool diff --git a/roles/openshift_hosted/tasks/registry/storage/registry_config.j2 b/roles/openshift_hosted/tasks/registry/storage/registry_config.j2 new file mode 120000 index 000000000..f3e82ad4f --- /dev/null +++ b/roles/openshift_hosted/tasks/registry/storage/registry_config.j2 @@ -0,0 +1 @@ +../../../templates/registry_config.j2
\ No newline at end of file diff --git a/roles/openshift_hosted/tasks/registry/storage/registry_config_secret.j2 b/roles/openshift_hosted/tasks/registry/storage/registry_config_secret.j2 new file mode 120000 index 000000000..b9e82c1ea --- /dev/null +++ b/roles/openshift_hosted/tasks/registry/storage/registry_config_secret.j2 @@ -0,0 +1 @@ +../../../templates/registry_config_secret.j2
\ No newline at end of file diff --git a/roles/openshift_hosted/tasks/router/router.yml b/roles/openshift_hosted/tasks/router/router.yml index c011db762..95f0617dc 100644 --- a/roles/openshift_hosted/tasks/router/router.yml +++ b/roles/openshift_hosted/tasks/router/router.yml @@ -9,10 +9,15 @@      module: slurp      src: "{{ item }}"    register: openshift_router_certificate_output +  # Defaulting dictionary keys to none to avoid deprecation warnings +  # (future fatal errors) during template evaluation. Dictionary keys +  # won't be accessed unless openshift_hosted_router_certificate is +  # defined and has all keys (certfile, keyfile, cafile) which we +  # check above.    with_items: -  - "{{ openshift_hosted_router_certificate.certfile }}" -  - "{{ openshift_hosted_router_certificate.keyfile }}" -  - "{{ openshift_hosted_router_certificate.cafile }}" +  - "{{ (openshift_hosted_router_certificate | default({'certfile':none})).certfile }}" +  - "{{ (openshift_hosted_router_certificate | default({'keyfile':none})).keyfile }}" +  - "{{ (openshift_hosted_router_certificate | default({'cafile':none})).cafile }}"    when: openshift_hosted_router_certificate is defined  - name: Persist certificate contents | 
