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_output_path: "/var/lib/agent_output"
- - name: Including auth vars
- include_vars: "{{ playbook_dir }}/creds.yml"
- - name: Avi Cloud | Setup AVI resources
- include_role:
- name: avinetworks.aviconfig
- vars:
- avi_config_file: "{{ playbook_dir }}/res_config_{{ test_name }}.yml"
- avi_creds_file: "{{ playbook_dir }}/creds.yml"
- - name: Get the created Virtual Service
- avi_api_session:
- api_version: "{{ avi_api_version }}"
- controller: "{{ avi_controller }}"
- username: "{{ avi_username }}"
- password: "{{ avi_password }}"
- http_method: get
- path: "virtualservice?name=test-vs&cloud_ref.name=openstack"
- register: vs
- - set_fact:
- avi_vs_uuid: "{{ vs.obj.results[0].uuid }}"
- avi_vs_floating_vip: "{{ vs.obj.results[0].vip[0].floating_ip.addr }}"
- - name: Check the VS operation state
- avi_api_session:
- api_version: "{{ avi_api_version }}"
- controller: "{{ avi_controller }}"
- username: "{{ avi_username }}"
- password: "{{ avi_password }}"
- http_method: get
- path: "virtualservice/{{ avi_vs_uuid }}/runtime/"
- register: vs_runtime
- until: vs_runtime.obj.oper_status.state == "OPER_UP"
- retries: 60
- delay: 10
- - name: Make sure the output path exists
- file:
- path: "{{ output_path|default(default_output_path) }}"
- state: directory
- mode: 0775
- recurse: yes
- - name: Save output to yaml
- template:
- src: output.yml.j2
- dest: "{{ output_path|default(default_output_path) }}/attributes.yaml"
Advertisement
Add Comment
Please, Sign In to add comment