forked from mlowcher61/F5-Ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
acproxy_install2.yml
executable file
·69 lines (54 loc) · 2.76 KB
/
acproxy_install2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/ansible-playbook
---
#
# Copyright (c) 2016 F5 Networks
# All rights reserved.
#
# author: Mark Lowcher F5 Networks
# description: This playbook will perform the steps to configure
# ACProxy on a linux machine in the cloud
# A deployment guide can be found at https://github.com/mlowcher61
# The steps are as follows:
# - Spin up an instance of Linux Ubuntu in your cloud.
# - Perform steps neccessary to have Ansible ssh to the linux host
# - Verify that the linux host can access the internet
# - Put ACproxy code into your working directory in Ansible host (~/ansible/playbooks)
# - Put docker.list file in the same directory.
# (See Ansible Orchestration for App Connector)
- name: Creating a docker system running two instances of ACproxy
hosts: acproxy
become: true
become_user: su
connection: local
gather_facts: no
vars:
appliance: "acproxy"
setup_user: "admin"
setup_pass: "austinproxy"
ACproxy_code: "f5-acproxy-1.1.0-build.70.tgz"
ACproxy_start: "acproxy:1.1.0-build.70"
tasks:
- name: Updating apt...
raw: sudo apt-get update
- name: Pull down docker key
raw: sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- name: Copying docker.list file to linux host
copy: src=~/ansible/playbooks/files/docker.list dest=/etc/apt/sources.list.d/
- name: makding cloud_vendors directory
raw: mkdir cloud_vendors
- name: making aws directory
raw: mkdir ./cloud_vendors/aws
- name: Copying aws_config.json file to linux host
copy: src=/var/tmp/aws_config.json dest=/home/ubuntu/cloud_vendors/aws mode=755
- name: Copying F5 AC_proxy software to linux host
copy: src=~/ansible/playbooks/f5-acproxy-1.1.0-build.70.tgz dest=/home/ubuntu mode=755
- name: Updating apt...
raw: sudo apt-get update
- name: Installing Docker on Linux host...
raw: sudo apt-get install docker-engine --assume-yes
- name: Loading AC_proxy
raw: sudo docker load -i "{{ACproxy_code}}"
- name: Firing up first instance of ACproxy at port 9001
raw: sudo docker run -d -e adminPort=9001 --restart=always --net=host -e proxyName=Proxy1 -e user="{{setup_user}}" -e passwd="{{setup_pass}}" -e publish=true -it -v /home/ubuntu/cloud_vendors/aws:/app/proxy/vendors/aws -v /app/proxy/log -v /app/proxy/config f5/"{{ACproxy_start}}"
- name: Firing up second instance of ACproxy at port 9002
raw: sudo docker run -d -e adminPort=9002 --restart=always --net=host -e proxyName=Proxy2 -e user="{{setup_user}}" -e passwd="{{setup_pass}}" -e publish=true-it -v /home/ubuntu/cloud_vendors/aws:/app/proxy/vendors/aws -v /app/proxy/log -v /app/proxy/config f5/"{{ACproxy_start}}"