Skip to content
Snippets Groups Projects
Commit d0c0617b authored by matt01671's avatar matt01671
Browse files

scripts'

parent 078c9370
Branches
No related tags found
No related merge requests found
- hosts: localhost
vars_files:
- host_vars/nectar.yaml
gather_facts: true
# - hosts: localhost
# vars_files:
# - host_vars/nectar.yaml
# gather_facts: true
roles:
- role: openstack-common
- role: openstack-volume
- role: openstack-security-group
- role: cluster-security-group
- role: openstack-instance
# roles:
# - role: openstack-common
# - role: openstack-volume
# - role: openstack-security-group
# - role: cluster-security-group
# - role: openstack-instance
- hosts: instances
vars_files:
- host_vars/docker.yaml
gather_facts: true
# - hosts: instances
# vars_files:
# - host_vars/docker.yaml
# gather_facts: true
roles:
- role: openstack-proxy
- role: all-dependencies
- role: all-mount
- role: all-docker
# roles:
# - role: openstack-proxy
# - role: all-dependencies
# - role: all-mount
# - role: all-docker
- hosts: dbs
......
......@@ -8,5 +8,29 @@
- debug: var=ansible_default_ipv4.address
- name: Remove a container
become: yes
docker_container:
name: couchdb${node}
state: absent
force_kill: yes
- name: Configure compose
tags: 'react-app'
become: yes
template:
src: edit-vm.sh
dest: "edit-vm.sh"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
- name: Build CouchDB
script: ./templates/run.sh --node '{{ ansible_default_ipv4.address }}'
register: out
- debug: var=out.stdout_lines
- name: Reboot machine
become: yes
reboot:
reboot_timeout: 3000
#!/usr/bin/env bash
cd /opt/couchdb/etc/
echo "-name couchdb@${node}" >> vm.args
\ No newline at end of file
......@@ -35,9 +35,12 @@ declare -a conts=(`sudo docker ps --all | grep couchdb | cut -f1 -d' ' | xargs -
echo "== Start the containers (and wait a bit while they boot): =="
for cont in "${conts[@]}"; do sudo docker start ${cont}; done
for cont in "${conts[@]}"; do sudo docker exec -it ${cont} bash; done
for cont in "${conts[@]}"; do sudo docker cp edit-vm.sh couchdb:/edit-vm.sh; done
cd /opt/couchdb/etc/
for cont in "${conts[@]}"; do sudo docker exec -u root -it ${cont} chmod u+x edit-vm.sh; done
for cont in "${conts[@]}"; do sudo docker exec -u root -it ${cont} "export node=${node}"; done #FIX
for cont in "${conts[@]}"; do sudo docker exec -u root -it ${cont} bash edit-vm.sh; done
sed -i "s/STRING_TO_REPLACE/STRING_TO_REPLACE_IT/g" <file>
#sudo docker exec -it couchdb bash
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment