Advertisement
eezhova

cloud.yml

Jan 25th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.77 KB | None | 0 0
  1. - import_playbook: render_configs.yml
  2.  
  3. - hosts: localhost
  4.   connection: local
  5.   roles:
  6.     - role: avinetworks.avisdk
  7.   tasks:
  8.     - set_fact:
  9.       default_input_path: "/var/lib/agent_input"
  10.     - name: Include variables
  11.       include_vars: "{{ input_path|default(default_input_path) }}/vars.yaml"
  12.     - name: Wait for AVI Controller API
  13.       command: "curl --location --insecure http://{{ avi_controller_ip }}/api/cluster/runtime"
  14.       register: result
  15.       until: "{{ result.stdout | from_json | json_query(query) }}"
  16.       vars:
  17.         query: 'cluster_state.progress==`100` && cluster_state.state==`"CLUSTER_UP_NO_HA"`'
  18.       retries: 360
  19.       delay: 10
  20.       changed_when: false
  21.     - name: Setting up cloud
  22.       debug: msg="openstack"
  23.     - name: Including auth vars
  24.       include_vars: "{{ playbook_dir }}/creds.yml"
  25.     - name: Set admin password
  26.       avi_api_session:
  27.         api_version: "{{ avi_api_version }}"
  28.         controller: "{{ avi_controller }}"
  29.         username: "{{ avi_username }}"
  30.         password: "{{ avi_default_password }}"
  31.         http_method: put
  32.         path: useraccount
  33.         data:
  34.           old_password: "{{ avi_default_password }}"
  35.           password: "{{ avi_password }}"
  36.     - debug: msg="{{ result }}"
  37.     - name: Creating System Configuration
  38.       avi_systemconfiguration:
  39.         api_version: "{{ avi_api_version }}"
  40.         controller: "{{ avi_controller }}"
  41.         username: "{{ avi_username }}"
  42.         password: "{{ avi_password }}"
  43.         state: present
  44.         dns_configuration:
  45.           search_domain: ""
  46.           server_list:
  47.             - addr: "8.8.8.8"
  48.               type: V4
  49.         docker_mode: false
  50.     - name: Avi Cloud | Setup an OpenStack Cloud
  51.       include_role:
  52.         name: avinetworks.aviconfig
  53.       vars:
  54.         avi_config_file: "{{ playbook_dir }}/cloud_config.yml"
  55.         avi_creds_file: "{{ playbook_dir }}/creds.yml"
  56.  
  57.     - name: Get the created Cloud
  58.       avi_api_session:
  59.         api_version: "{{ avi_api_version }}"
  60.         controller: "{{ avi_controller }}"
  61.         username: "{{ avi_username }}"
  62.         password: "{{ avi_password }}"
  63.         http_method: get
  64.         path: "cloud?name=openstack"
  65.       register: cloud
  66.     - set_fact:
  67.         avi_cloud_uuid: "{{ cloud.obj.results[0].uuid }}"
  68.     - pause:
  69.         seconds: 5
  70.     - name: Check the Cloud operation state
  71.       avi_api_session:
  72.         api_version: "{{ avi_api_version }}"
  73.         controller: "{{ avi_controller }}"
  74.         username: "{{ avi_username }}"
  75.         password: "{{ avi_password }}"
  76.         http_method: get
  77.         path: "cloud/{{ avi_cloud_uuid }}/status/"
  78.       register: cloud_status
  79.       until: cloud_status.obj.state == "CLOUD_STATE_PLACEMENT_READY"
  80.       retries: 60
  81.       delay: 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement