Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - import_playbook: render_configs.yml
- - hosts: localhost
- connection: local
- roles:
- - role: avinetworks.avisdk
- tasks:
- - set_fact:
- default_input_path: "/var/lib/agent_input"
- - name: Include variables
- include_vars: "{{ input_path|default(default_input_path) }}/vars.yaml"
- - name: Wait for AVI Controller API
- command: "curl --location --insecure http://{{ avi_controller_ip }}/api/cluster/runtime"
- register: result
- until: "{{ result.stdout | from_json | json_query(query) }}"
- vars:
- query: 'cluster_state.progress==`100` && cluster_state.state==`"CLUSTER_UP_NO_HA"`'
- retries: 360
- delay: 10
- changed_when: false
- - name: Setting up cloud
- debug: msg="openstack"
- - name: Including auth vars
- include_vars: "{{ playbook_dir }}/creds.yml"
- - name: Set admin password
- avi_api_session:
- api_version: "{{ avi_api_version }}"
- controller: "{{ avi_controller }}"
- username: "{{ avi_username }}"
- password: "{{ avi_default_password }}"
- http_method: put
- path: useraccount
- data:
- old_password: "{{ avi_default_password }}"
- password: "{{ avi_password }}"
- - debug: msg="{{ result }}"
- - name: Creating System Configuration
- avi_systemconfiguration:
- api_version: "{{ avi_api_version }}"
- controller: "{{ avi_controller }}"
- username: "{{ avi_username }}"
- password: "{{ avi_password }}"
- state: present
- dns_configuration:
- search_domain: ""
- server_list:
- - addr: "8.8.8.8"
- type: V4
- docker_mode: false
- - name: Avi Cloud | Setup an OpenStack Cloud
- include_role:
- name: avinetworks.aviconfig
- vars:
- avi_config_file: "{{ playbook_dir }}/cloud_config.yml"
- avi_creds_file: "{{ playbook_dir }}/creds.yml"
- - name: Get the created Cloud
- avi_api_session:
- api_version: "{{ avi_api_version }}"
- controller: "{{ avi_controller }}"
- username: "{{ avi_username }}"
- password: "{{ avi_password }}"
- http_method: get
- path: "cloud?name=openstack"
- register: cloud
- - set_fact:
- avi_cloud_uuid: "{{ cloud.obj.results[0].uuid }}"
- - pause:
- seconds: 5
- - name: Check the Cloud operation state
- avi_api_session:
- api_version: "{{ avi_api_version }}"
- controller: "{{ avi_controller }}"
- username: "{{ avi_username }}"
- password: "{{ avi_password }}"
- http_method: get
- path: "cloud/{{ avi_cloud_uuid }}/status/"
- register: cloud_status
- until: cloud_status.obj.state == "CLOUD_STATE_PLACEMENT_READY"
- retries: 60
- delay: 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement