-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_awx.sh
executable file
·130 lines (114 loc) · 4.68 KB
/
install_awx.sh
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/sh
export old_mism_version=$MISM_BULLSEQUANA_EDGE_VERSION
rm -f install_awx_from_atos_dockerhub.sh
rm -f start_awx_from_atos_dockerhub.sh
rm -f stop_awx_from_atos_dockerhub.sh
. ./check_prerequisites.sh
# comment the next line if you build from your own Dockerfiles with build_awx.sh
. ./remove_awx_containers_and_images.sh
. ./proxy.sh
. ./versions.sh
if [ ! -z $MISM_BULLSEQUANA_EDGE_VERSION ]
then
if [ ! -z $old_mism_version ]
then
if [ $old_mism_version != $MISM_BULLSEQUANA_EDGE_VERSION ]
then
rm -f bullsequana-edge-system-management_awx_web.$old_mism_version.tar
rm -f bullsequana-edge-system-management_awx_task.$old_mism_version.tar
rm -f awx_web.$old_mism_version.tar
rm -f awx_task.$old_mism_version.tar
rm -f rabbitmq.$old_mism_version.tar
rm -f memcached.$old_mism_version.tar
rm -f postgres.$old_mism_version.tar
rm -f pgadmin4.$old_mism_version.tar
fi
fi
fi
export docker_image=`docker images |grep $MISM_BULLSEQUANA_EDGE_VERSION |grep 'bullsequana-edge-system-management_awx_web' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f bullsequana-edge-system-management_awx_web.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading Bull AWX web image ...."
docker load --input bullsequana-edge-system-management_awx_web.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
export docker_image=`docker images |grep $MISM_BULLSEQUANA_EDGE_VERSION |grep 'bullsequana-edge-system-management_awx_task' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f bullsequana-edge-system-management_awx_task.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading Bull AWX task image ...."
docker load --input bullsequana-edge-system-management_awx_task.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
export docker_image=`docker images |grep $AWX_BULLSEQUANA_EDGE_VERSION |grep 'ansible/awx_web' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f awx_web.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading ansible/awx_web image ...."
docker load --input awx_web.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
export docker_image=`docker images |grep $AWX_BULLSEQUANA_EDGE_VERSION |grep 'ansible/awx_task' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f awx_task.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading ansible/awx_task image ...."
docker load --input awx_task.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
export docker_image=`docker images |grep $RABBITMQ_AWX_BULLSEQUANA_EDGE_VERSION |grep 'rabbitmq' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f rabbitmq.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading rabbitmq $MISM_BULLSEQUANA_EDGE_VERSION image ...."
docker load --input rabbitmq.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
export docker_image=`docker images |grep $MEMCACHED_AWX_BULLSEQUANA_EDGE_VERSION |grep 'memcached' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f memcached.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading memcached $MISM_BULLSEQUANA_EDGE_VERSION image ...."
docker load --input memcached.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
export docker_image=`docker images |grep $POSTGRES_AWX_BULLSEQUANA_EDGE_VERSION |grep 'postgres' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f postgres.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading postgres $MISM_BULLSEQUANA_EDGE_VERSION image ...."
docker load --input postgres.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
export docker_image=`docker images |grep $PGADMIN_AWX_BULLSEQUANA_EDGE_VERSION |grep 'pgadmin4' |awk '{ print $3; }'`
if [ -z "$docker_image" ]
then
if [ -f pgadmin4.$MISM_BULLSEQUANA_EDGE_VERSION.tar ]
then
echo "loading pgadmin4 $MISM_BULLSEQUANA_EDGE_VERSION image ...."
docker load --input pgadmin4.$MISM_BULLSEQUANA_EDGE_VERSION.tar
fi
fi
if [ ! -f ansible/vars/passwords.yml ]
then
echo -e "\033[32mansible/vars/passwords.yml was successfully created\033[0m"
touch ansible/vars/passwords.yml
fi
echo "starting BullSequana Edge Ansible AWX containers ...."
docker-compose -f docker_compose_awx.yml up -d
echo "----------------------------------------------------------------------------------------------------"
echo -e "Now wait \e[101m10 minutes\e[0m for the migration to complete...."
echo "check the login page at https://localhost"
echo "and run ./add_awx_playbooks.sh"
echo "AWX is available on https://localhost"
echo "pgadmin is available on http://localhost:7070"
echo "for more info, refer to github site https://github.com/atosorigin/bullsequana-edge-system-management"
echo "----------------------------------------------------------------------------------------------------"