Compare commits
2 Commits
485ddb3147
...
ac78a1a272
Author | SHA1 | Date | |
---|---|---|---|
|
ac78a1a272 | ||
|
4c219eafc2 |
7
cassandra.yml
Normal file
7
cassandra.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
# Run all plays as root.
|
||||||
|
- hosts: cassandra
|
||||||
|
become: True
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
|
- cassandra
|
21
hosts
21
hosts
@ -2,15 +2,20 @@
|
|||||||
ansible-test
|
ansible-test
|
||||||
[keystone]
|
[keystone]
|
||||||
ansible-test
|
ansible-test
|
||||||
[registry]
|
[dockerregistry]
|
||||||
ansible-test
|
openstack01-node01
|
||||||
[rabbitmq]
|
[rabbitmq]
|
||||||
ansible-test
|
ansible-test
|
||||||
ansible-test-2
|
ansible-test-2
|
||||||
ansible-test-3
|
ansible-test-3
|
||||||
|
[cassandra]
|
||||||
|
openstack01-node[01:03]
|
||||||
|
[first_cassandra]
|
||||||
|
openstack01-node01
|
||||||
|
[next_cassandra]
|
||||||
|
openstack01-node02
|
||||||
|
openstack01-node03
|
||||||
|
[first_cassandra:vars]
|
||||||
|
run_options=""
|
||||||
|
[next_cassandra:vars]
|
||||||
|
run_options="-e CASSANDRA_SEEDS=172.23.41.1"
|
||||||
|
16
roles/cassandra/tasks/main.yml
Normal file
16
roles/cassandra/tasks/main.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Install a docker based cassandra cluster.
|
||||||
|
---
|
||||||
|
- include: ../common/tasks/docker.yml
|
||||||
|
- name: install service file.
|
||||||
|
template:
|
||||||
|
src: templates/cassandra.service
|
||||||
|
dest: /etc/systemd/system/cassandra.service
|
||||||
|
mode: 644
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
- name: install service file
|
||||||
|
command: systemctl daemon-reload
|
||||||
|
- name: make sure service is started
|
||||||
|
systemd:
|
||||||
|
name: cassandra.service
|
||||||
|
state: started
|
19
roles/cassandra/templates/cassandra.service
Normal file
19
roles/cassandra/templates/cassandra.service
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Cassandra Container
|
||||||
|
After=docker.service
|
||||||
|
Requires=docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
TimeoutStartSec=0
|
||||||
|
Restart=always
|
||||||
|
ExecStartPre=-/usr/bin/docker stop %n
|
||||||
|
ExecStartPre=-/usr/bin/docker rm %n
|
||||||
|
ExecStartPre=/usr/bin/docker pull cassandra:3.10
|
||||||
|
ExecStart=/usr/bin/docker run --name %n -v /srv/lib/cassandra:/var/lib/cassandra \
|
||||||
|
-p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 \
|
||||||
|
-e CASSANDRA_BROADCAST_ADDRESS={{ansible_default_ipv4.address}} \
|
||||||
|
-e CASSANDRA_START_RPC=True \
|
||||||
|
{{run_options}} cassandra:3.10
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -9,9 +9,8 @@ Restart=on-failure
|
|||||||
ExecStartPre=-/usr/bin/docker stop %n
|
ExecStartPre=-/usr/bin/docker stop %n
|
||||||
ExecStartPre=-/usr/bin/docker rm %n
|
ExecStartPre=-/usr/bin/docker rm %n
|
||||||
ExecStartPre=/usr/bin/docker pull registry:2
|
ExecStartPre=/usr/bin/docker pull registry:2
|
||||||
ExecStart=/usr/bin/docker run -d -p 5000:5000 --restart=always --name %n \
|
ExecStart=/usr/bin/docker run -d -p 5000:5000 --name %n \
|
||||||
-v /srv/dockerregistry/auth:/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
|
-v /srv/dockerregistry/certs:/certs \
|
||||||
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -v /srv/dockerregistry/certs:/certs \
|
|
||||||
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/docker-registry.hpc.service.rug.nl.crt \
|
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/docker-registry.hpc.service.rug.nl.crt \
|
||||||
-e REGISTRY_HTTP_TLS_KEY=/certs/docker-registry.hpc.service.rug.nl.key \
|
-e REGISTRY_HTTP_TLS_KEY=/certs/docker-registry.hpc.service.rug.nl.key \
|
||||||
-e REGISTRY_HTTP_SECRET=jahNoh2teev0 registry:2
|
-e REGISTRY_HTTP_SECRET=jahNoh2teev0 registry:2
|
||||||
|
Loading…
Reference in New Issue
Block a user