1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- ---
- - hosts: localhost
- gather_facts: no
- tasks:
- - name: provision resource group
- import_tasks: tasks/provision_instance.yml
- vars:
- image_prefix: "{{ openshift_azure_input_image_prefix }}"
- image_resource_group: "{{ openshift_azure_input_image_ns }}"
- create_args: --data-disk-sizes-gb 128
- - set_fact:
- openshift_node_bootstrap: True
- - hosts: nodes
- tasks:
- - set_fact:
- openshift_deployment_type: "{{ 'openshift-enterprise' if ansible_distribution == 'RedHat' else 'origin' }}"
- openshift_enable_origin_repo: False
- openshift_node_bootstrap: True
- skip_node_svc_handlers: True
- openshift_additional_repos: "{{ azure_node_repos[ansible_distribution] }}"
- openshift_node_include_control_plane: True
- openshift_control_plane_static_pod_location: /etc/origin/node/disabled/
- openshift_node_image_prep_packages:
- - strace
- etcd_ip: ETCD_IP_REPLACE
- - name: add insights-client to package installs when on rhel
- set_fact:
- openshift_node_image_prep_packages: "{{ openshift_node_image_prep_packages | union(['insights-client']) }}"
- when: openshift_deployment_type == 'openshift-enterprise'
- - set_fact:
- openshift_additional_repos: "{{ openshift_additional_repos + [{'name': 'install_repo', 'baseurl': openshift_azure_install_repo, 'enabled': true, 'gpgcheck': false}] }}"
- when: openshift_azure_install_repo is defined and openshift_azure_install_repo
- - name: install centos-release-paas-common rpm
- yum:
- name: centos-release-paas-common
- state: present
- when: ansible_distribution == "CentOS"
- - name: configure yum repositories
- import_tasks: tasks/yum_certs.yml
- - name: update rpms
- import_role:
- name: os_update_latest
- vars:
- os_update_latest_reboot: True
- - name: install openshift
- import_playbook: ../../openshift-node/private/image_prep.yml
- - hosts: nodes
- tasks:
- - name: deconfigure yum repositories
- import_tasks: tasks/remove_yum.yml
- - name: record installed rpms
- yum:
- list: installed
- register: yum
- - name: run waagent deprovision
- shell: sleep 2 && waagent -deprovision+user -force
- async: 1
- poll: 0
- - hosts: localhost
- gather_facts: no
- tasks:
- - name: get current date/time
- shell: TZ=Etc/UTC date +%Y%m%d%H%M
- register: now
- - set_fact:
- openshift_rpm: "{{ hostvars[groups['nodes'][0]]['yum'].results | selectattr('name', 'match', '^(origin|atomic-openshift)$') | first }}"
- - set_fact:
- image_name: "{{ openshift_azure_output_image_prefix }}-{{ openshift_rpm.version | regex_replace('^(\\d+\\.\\d+).*', '\\1') }}-{{ now.stdout }}"
- - name: create image
- import_tasks: tasks/create_image_from_vm.yml
- vars:
- image_resource_group: "{{ openshift_azure_output_image_ns }}"
- image_tags:
- base_image: "{{ (input_image.stdout | from_json).name }}"
- kernel: "{{ hostvars[groups['nodes'][0]]['ansible_kernel'] }}"
- openshift: "{{ openshift_rpm.name }}-{{ openshift_rpm.version }}-{{ openshift_rpm.release }}.{{ openshift_rpm.arch }}"
- - name: create blob
- import_tasks: tasks/create_blob_from_vm.yml
- when: openshift_azure_storage_account is defined and openshift_azure_storage_account
|