Builds AS3 declarations based on inputs from variable files provided. Enables the ability to abstract complexities using AS3 and Ansible.
- User updates environment variables in vars/main.yaml
- User provides app variables in app-inputs directory
- create_app.yaml creates AS3 declaration segments based on templates within j2 directory.
- push_config.yaml merges AS3 segements into single declarations and pushes across all BIG-IPs in the vars/main.yaml file
-
Edit the hosts file.
- In the examples hosts file there are 3 BIG-IPs (Zone1, Zone2, aws). Update these to match the infrastructure of your orginization.
- Make sure to update the localhost device to use the correct python env interpreter.
-
Update vars/main.yaml to reference the
hosts
you created along with the Tenants required for your applications.datacenters: - aws - Zone1 - Zone2 tenants: - Tenant1 - Tenant2 f5_user: admin f5_password: admin
- Ensure that the password is encrypted with vault when used outside of this demo.
ansible-vault encrypt_string admin --ask-vault-pass --name f5_password
- Ensure that the password is encrypted with vault when used outside of this demo.
-
Create var files that represent your application ADC parameters within the app-inputs directory. There are 3 example var files provided within the repo.
-
Create the AS3 declaration fragments using the create_app.yaml playbook.
ansible-playbook -i hosts create_app.yaml -e "@app-inputs/App1.yaml"
- You will notice that this playbook will also create the apps folder and then tree out each Zone/Tenant combination.
├── apps │ ├── Zone1 │ │ ├── Tenant1 │ │ │ └── App1.json │ │ └── Tenant2 │ │ └── App3.json │ ├── Zone2 │ │ ├── Tenant1 │ │ │ ├── App1.json │ │ │ └── App2.json │ │ └── Tenant2 │ └── aws │ ├── Tenant1 │ │ ├── App1.json │ │ └── App2.json │ └── Tenant2 │ └── App3.json
-
This is hopefully a temporary step. As of right now one of the modules within push_config.yaml requires a full path and does not work with relative. Please update the
dest
line as below to match your environment./Users/test/Desktop/sc/ansible-as3-app-files/
- name: Group all Application Files
assemble:
....
dest: /Users/test/Desktop/sc/ansible-as3-app-files/tmp/{{item[0]}}-{{item[1]}}_combined.yaml
- Run the push_config.yaml playbook to actually push the AS3 declarations to your BIG-IPs. Remember to use
--ask-vault-pass
parameter if you have encrypted the passwords for your BIG-IPs.ansible-playbook -i hosts push_config.yaml