| | |
| | | # include global vars from the config |
| | | - import_playbook: ../../include_vars.yml |
| | | |
| | | - import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/pre_infra.yml" |
| | | - import_playbook: pre_infra.yml |
| | | tags: |
| | | - step000 |
| | | - pre_infra_tasks |
| | |
| | | connection: local |
| | | gather_facts: false |
| | | become: false |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | tasks: |
| | | - name: Assert new_node_instance_count and node_instance_count are setup properly. |
| | | tags: assert_new_node |
| | |
| | | ################################################################################# |
| | | ################################################################################# |
| | | |
| | | - import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/post_infra.yml" |
| | | - import_playbook: post_infra.yml |
| | | tags: |
| | | - step002 |
| | | - post_infra_tasks |
| | |
| | | - "newnodes" |
| | | become: true |
| | | gather_facts: False |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" |
| | | tags: |
| | | - step004 |
| | | - common_tasks |
| | |
| | | connection: local |
| | | gather_facts: false |
| | | become: false |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" |
| | | tags: |
| | | - flight_check |
| | | tasks: |
| | |
| | | - name: Configuring openshift-nodes |
| | | gather_facts: False |
| | | become: yes |
| | | |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" |
| | | hosts: |
| | | - "newnodes" |
| | | roles: |
| | |
| | | hosts: bastions |
| | | become: true |
| | | gather_facts: False |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" |
| | | tags: |
| | | - openshift_host_templates |
| | | tasks: |
| | |
| | | gather_facts: False |
| | | become: yes |
| | | hosts: bastions[0] |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | tags: |
| | | - installing_openshift |
| | | ## Change to scale up, and change inventory file |
| | | tasks: |
| | | - name: run scaleup playbook (pre 3.9.33) |
| | | - name: Run scaleup playbook (pre 3.9.33) |
| | | shell: "ansible-playbook -i /etc/ansible/scaleup_hosts /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-node/scaleup.yml" |
| | | register: openshift_install_log |
| | | when: osrelease is version_compare('3.9.33', '<') |
| | | tags: |
| | | - openshift_installer |
| | | - name: run scaleup playbook (3.9.33 and later) |
| | | - name: Run scaleup playbook (3.9.33 and later) |
| | | shell: "ansible-playbook -i /etc/ansible/scaleup_hosts /usr/share/ansible/openshift-ansible/playbooks/openshift-node/scaleup.yml" |
| | | register: openshift_install_log |
| | | when: osrelease is version_compare('3.9.33', '>=') |
| | | tags: |
| | | - openshift_installer |
| | | - name: show output of the scaleup playbook |
| | | - name: Show output of the scaleup playbook |
| | | debug: |
| | | var: openshift_install_log |
| | | verbosity: 2 |
| | |
| | | become: yes |
| | | hosts: masters |
| | | run_once: yes |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | tags: |
| | | - installing_openshift |
| | | ## Change to scale up, and change inventory file |
| | | tasks: |
| | | - name: Tag new nodes with logging-infra-fluentd=true |
| | | shell: "oc label node {{ item }} logging-infra-fluentd=true" |
| | | shell: "oc label node --overwrite {{ item }} logging-infra-fluentd=true" |
| | | with_items: "{{ groups['newnodes'] }}" |
| | | when: install_logging|d(true)|bool |
| | | |
| | |
| | | connection: local |
| | | become: False |
| | | gather_facts: False |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" |
| | | tags: |
| | | - generate_ansible_hosts_file |
| | | tasks: |
| | | # untag nodes, remove newnode tag |
| | | - name: Ensure tags 'newnode' for instance is set to 'false' |
| | | environment: |
| | | AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" |
| | | AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" |
| | | AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}" |
| | | ec2_tag: |
| | | region: "{{ aws_region_final|d(aws_region) }}" |
| | | resource: "{{ hostvars[item].instance_id }}" |
| | |
| | | - name: Remove hosts from group newnodes |
| | | gather_facts: False |
| | | become: yes |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" |
| | | hosts: newnodes |
| | | tasks: |
| | | - group: |
| | |
| | | hosts: bastions |
| | | become: true |
| | | gather_facts: False |
| | | vars_files: |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" |
| | | - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" |
| | | tags: |
| | | - openshift_host_templates |
| | | tasks: |
| | |
| | | msg: "WARNING: s3user credentials not set" |
| | | when: s3user_access_key is not defined |
| | | |
| | | - name: generate ansible hosts file, keep it under workdir |
| | | - name: Generate ansible hosts file, keep it under workdir |
| | | template: |
| | | src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.{{ osrelease }}.j2" |
| | | dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" |