| | |
| | | gather_facts: false |
| | | become: true |
| | | tasks: |
| | | - when: cloud_provider == "osp" |
| | | block: |
| | | - name: Install packages for OpenStack CLI |
| | | package: |
| | | name: |
| | | - gcc |
| | | - python3 |
| | | - python3-devel |
| | | |
| | | - name: Copy requirements.txt |
| | | copy: |
| | | src: "./files/openstack_requirements.txt" |
| | | dest: "/root/requirements.txt" |
| | | |
| | | - name: Install python requirements for OpenStack CLI |
| | | command: "pip3 install -r /root/requirements.txt" |
| | | |
| | | - name: Remove requirements.txt |
| | | file: |
| | | path: "/root/requirements.txt" |
| | | state: absent |
| | | |
| | | - name: Add /usr/local/bin to PATH |
| | | copy: |
| | | dest: /etc/profile.d/custom-path.sh |
| | | content: 'PATH=$PATH:/usr/local/bin' |
| | | |
| | | - name: Create .config directory |
| | | file: |
| | | path: /home/{{ student_name }}/.config/openstack |
| | | state: directory |
| | | owner: "{{ student_name }}" |
| | | group: users |
| | | mode: 0744 |
| | | |
| | | - name: Create clouds.yaml file |
| | | template: |
| | | src: "./files/clouds.yaml.j2" |
| | | dest: "/home/{{ student_name }}/.config/openstack/clouds.yaml" |
| | | owner: "{{ student_name }}" |
| | | mode: 0700 |
| | | |
| | | - name: Add environment variables for API and Ingress FIPs |
| | | lineinfile: |
| | | path: "/home/{{ student_name }}/.bashrc" |
| | | regexp: "^export {{ item.env_var }}" |
| | | line: "export {{ item.env_var }}={{ item.ip }}" |
| | | loop: |
| | | - ip: "{{ hostvars['localhost']['ocp_api_fip'] }}" |
| | | env_var: "API_FIP" |
| | | - ip: "{{ hostvars['localhost']['ocp_ingress_fip'] }}" |
| | | env_var: "INGRESS_FIP" |
| | | loop_control: |
| | | label: item.ip |
| | | when: openshift_fip_provision |
| | | |
| | | - name: Add environment variable for DNS domain |
| | | lineinfile: |
| | | path: "/home/{{ student_name }}/.bashrc" |
| | | regexp: "^export OPENSHIFT_DNS_ZONE" |
| | | line: "export OPENSHIFT_DNS_ZONE={{ osp_cluster_dns_zone }}" |
| | | when: openshift_fip_provision |
| | | |
| | | - name: Add environment variable for OpenStack credentials |
| | | lineinfile: |
| | | path: "/home/{{ student_name }}/.bashrc" |
| | | regexp: "^export OS_CLOUD" |
| | | line: "export OS_CLOUD={{ guid }}-project" |
| | | |
| | | - name: Create resources directory |
| | | file: |
| | | path: "/home/{{ student_name }}/resources" |
| | | state: directory |
| | | owner: "{{ student_name }}" |
| | | group: users |
| | | mode: 0744 |
| | | |
| | | - name: Add python script to update ignition |
| | | copy: |
| | | dest: "/home/{{ student_name }}/resources/update_ignition.py" |
| | | src: "./files/update_ignition.py" |
| | | owner: "{{ student_name }}" |
| | | |
| | | - name: Add jinja for machinesets to resources directory |
| | | copy: |
| | | dest: "/home/{{ student_name }}/resources/general-ms.yaml.j2" |
| | | src: "./files/general-ms.yaml.j2" |
| | | owner: "{{ student_name }}" |
| | | |
| | | - name: Add PV file for OCP registry |
| | | template: |
| | | src: "./files/pv-registry.yaml.j2" |
| | | dest: "/home/{{ student_name }}/resources/pv-registry.yaml" |
| | | owner: "{{ student_name }}" |
| | | |
| | | - name: Add PV files for user vols |
| | | template: |
| | | src: "./files/pv-user.yaml.j2" |
| | | dest: "/home/{{ student_name }}/resources/pv-user.yaml" |
| | | owner: "{{ student_name }}" |
| | | |
| | | - name: Add PVC file for OCP registry |
| | | copy: |
| | | src: "./files/pvc-registry.yaml" |
| | | dest: "/home/{{ student_name }}/resources/pvc-registry.yaml" |
| | | owner: "{{ student_name }}" |
| | | |
| | | # In case we ever use Swift or something similar for bootstrap.ign |
| | | # - name: Create swift container for ignition |
| | | # command: | |
| | | # /usr/local/bin/openstack --os-cloud {{ osp_project_name }} container create ignition |
| | | # become_user: "{{ student_name }}" |
| | | |
| | | # - name: Set ACL for ignition container |
| | | # command: | |
| | | # /usr/local/bin/swift post --read-acl ".r:*,.rlistings" ignition |
| | | # become_user: "{{ student_name }}" |
| | | # environment: |
| | | # OS_AUTH_URL: "{{ osp_auth_url }}" |
| | | # OS_USERNAME: "{{ guid }}-user" |
| | | # OS_PASSWORD: "{{ hostvars['localhost']['heat_user_password'] }}" |
| | | # OS_PROJECT_NAME: "{{ osp_project_name }}" |
| | | # OS_PROJECT_DOMAIN_ID: "{{ osp_auth_project_domain }}" |
| | | |
| | | # - name: Add signing key for Swift tempurl |
| | | # command: | |
| | | # /usr/local/bin/openstack --os-cloud {{ osp_project_name }} object store account set --property Temp-URL-Key=redhatgpte |
| | | # become_user: "{{ student_name }}" |
| | | |
| | | - name: Run OCP4 Provisioner |
| | | include_role: |
| | | name: host-ocp4-provisioner |
| | | |
| | | - name: Step 002 rootless podman |
| | | hosts: bastions,utility |
| | | gather_facts: false |
| | |
| | | remote_src: true |
| | | |
| | | - name: Update CA trust |
| | | command: update-ca-trust |
| | | command: update-ca-trust |
| | | |
| | | - name: Step 005 Install OpenShift |
| | | hosts: bastions |
| | | gather_facts: false |
| | | become: false |
| | | tasks: |
| | | - name: Install OpenShift |
| | | include_role: |
| | | name: host-ocp4-installer |