Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
comp90023-assignment-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matthew O'Halloran
comp90023-assignment-2
Commits
e9a1f72c
Commit
e9a1f72c
authored
May 1, 2020
by
matt01671
Browse files
Options
Downloads
Patches
Plain Diff
sudo?
parent
c371233d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ansible/roles/cluster-build/templates/run.sh
+7
-7
7 additions, 7 deletions
ansible/roles/cluster-build/templates/run.sh
ansible/test.sh
+3
-0
3 additions, 0 deletions
ansible/test.sh
ansible/test.yaml
+45
-0
45 additions, 0 deletions
ansible/test.yaml
with
55 additions
and
7 deletions
ansible/roles/cluster-build/templates/run.sh
+
7
−
7
View file @
e9a1f72c
...
...
@@ -12,21 +12,21 @@ export cookie='a192aeb9904e6590849337933b000c99'
export
uuid
=
'a192aeb9904e6590849337933b001159'
echo
"== Pull image =="
docker pull ibmcom/couchdb3:
${
VERSION
}
sudo
docker pull ibmcom/couchdb3:
${
VERSION
}
echo
"== Create Docker containers =="
for
node
in
"
${
nodes
[@]
}
"
do
if
[
!
-z
$(
docker ps
--all
--filter
"name=couchdb
${
node
}
"
--quiet
)
]
if
[
!
-z
$(
sudo
docker ps
--all
--filter
"name=couchdb
${
node
}
"
--quiet
)
]
then
docker stop
$(
docker ps
--all
--filter
"name=couchdb
${
node
}
"
--quiet
)
docker
rm
$(
docker ps
--all
--filter
"name=couchdb
${
node
}
"
--quiet
)
sudo
docker stop
$(
sudo
docker ps
--all
--filter
"name=couchdb
${
node
}
"
--quiet
)
sudo
docker
rm
$(
sudo
docker ps
--all
--filter
"name=couchdb
${
node
}
"
--quiet
)
fi
done
for
node
in
"
${
nodes
[@]
}
"
do
docker create
\
sudo
docker create
\
--name
couchdb
${
node
}
\
--env
COUCHDB_USER
=
${
user
}
\
--env
COUCHDB_PASSWORD
=
${
pass
}
\
...
...
@@ -37,10 +37,10 @@ for node in "${nodes[@]}"
done
echo
"== Put in conts the Docker container IDs: =="
declare
-a
conts
=(
`
docker ps
--all
|
grep
couchdb |
cut
-f1
-d
' '
| xargs
-n
${
size
}
-d
'\n'
`
)
declare
-a
conts
=(
`
sudo
docker ps
--all
|
grep
couchdb |
cut
-f1
-d
' '
| xargs
-n
${
size
}
-d
'\n'
`
)
echo
"== Start the containers (and wait a bit while they boot): =="
for
cont
in
"
${
conts
[@]
}
"
;
do
docker start
${
cont
}
;
done
for
cont
in
"
${
conts
[@]
}
"
;
do
sudo
docker start
${
cont
}
;
done
echo
"== Set up the CouchDB cluster: =="
for
node
in
${
othernodes
}
...
...
This diff is collapsed.
Click to expand it.
ansible/test.sh
0 → 100755
+
3
−
0
View file @
e9a1f72c
#!/usr/bin/env bash
.
./unimelb-comp90024-2020-grp-62-openrc.sh
;
ansible-playbook
--ask-become-pass
test.yaml
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ansible/test.yaml
0 → 100644
+
45
−
0
View file @
e9a1f72c
-
hosts
:
localhost
vars
:
sg_name
:
question_1
sg_description
:
"
Question
1"
sg_protocol
:
tcp
sg_port_min
:
3306
sg_port_max
:
3306
sg_remote_group
:
'
{{
sg_name
}}'
instance_names
:
-
name
:
demo-01
-
name
:
demo-02
instance_image
:
45225edb-66d8-4fd0-bf41-132a31a18166
instance_key_name
:
test-moh
instance_flavor
:
uom.mse.2c9g
instance_az
:
melbourne-qh2-uom
tasks
:
-
name
:
Create a security group
os_security_group
:
name
:
'
{{
sg_name
}}'
description
:
'
{{
sg_description
}}'
state
:
present
-
name
:
Create security group rules
os_security_group_rule
:
security_group
:
'
{{
sg_name
}}'
protocol
:
'
{{
sg_protocol
}}'
port_range_min
:
'
{{
sg_port_min
}}'
port_range_max
:
'
{{
sg_port_max
}}'
remote_group
:
'
{{
sg_remote_group
}}'
state
:
present
-
name
:
Add security group to instance
os_server
:
name
:
'
{{
item.name
}}'
image
:
'
{{
instance_image
}}'
key_name
:
'
{{
instance_key_name
}}'
flavor
:
'
{{
instance_flavor
}}'
availability_zone
:
'
{{
instance_az
}}'
security_groups
:
-
'
{{
sg_name
}}'
-
demo_ssh-adv
timeout
:
600
state
:
present
loop
:
'
{{
instance_names
}}'
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment