Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions chatops_deployment/ansible/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
roles:
- role: ssh_known_hosts
tags: known_hosts

- name: Create certificates
hosts: localhost
roles:
- role: ssl_certificates
tags: ssl_certificates
1 change: 1 addition & 0 deletions chatops_deployment/ansible/roles/cadvisor/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
name: cadvisor
pull: always
state: started
restart_policy: "always"
ports:
- "8080:8080"
volumes:
Expand Down
13 changes: 7 additions & 6 deletions chatops_deployment/ansible/roles/chatops/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@

- name: Start ChatOps container
community.docker.docker_container:
image: harbor.stfc.ac.uk/stfc-cloud/cloud-chatops:7.0.0
name: chatops
image: "{{ chatops_image }}"
name: "chatops-{{ count }}"
pull: always
state: started
restart: true
ports:
- "3000:3000"
- "3030:3000"
volumes:
- /etc/chatops/config.yml:/usr/src/app/cloud_chatops/config/config.yml
- /etc/chatops/secrets.yml:/usr/src/app/cloud_chatops/secrets/secrets.yml
network_mode: host
- /etc/chatops/config.yml:/usr/src/app/config.yml
- /etc/chatops/secrets.yml:/usr/src/app/secrets.yml
restart_policy: "always"

- name: Copy filebeat external config
become: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ SLACK_BOT_TOKEN: {{ chatops_slack_bot_token }}
SLACK_SIGNING_SECRET: {{ chatops_slack_signing_secret }}
SCHEDULED_REMINDER_TOKEN: {{ chatops_custom_api_token }}
GITHUB_TOKEN: {{ chatops_github_token }}
GITLAB_TOKEN: {{ chatops_gitlab_token_token }}
GITLAB_TOKEN: {{ chatops_gitlab_token }}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
become: true
ansible.builtin.template:
src: logstash.conf.j2
dest: "/etc/logstash/logstash.conf"
dest: "/etc/logstash/conf.d/logstash.conf"
owner: root
group: logstash
mode: "0640"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ backend ALERTMANAGER
server alertmanager localhost:9093 check ssl verify required ca-file /etc/haproxy/ssl/alertmanager.crt

backend CHATOPS
server chatops_0 localhost:3030 check
server chatops_1 localhost:3031 check
server chatops_2 localhost:3032 check backup
server chatops localhost:3030 check

backend KIBANA
server kibana localhost:5601 check ssl verify required ca-file /etc/haproxy/ssl/kibana.crt
8 changes: 0 additions & 8 deletions chatops_deployment/ansible/roles/terraform/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,3 @@
force_init: true
workspace: "{{ env }}"
register: terraform_output

- name: Write ansible inventory file from Terraform outputs
ansible.builtin.template:
src: hosts.ini.j2
dest: "{{ playbook_dir }}/hosts.ini"
owner: "{{ ansible_env.USER }}"
group: "{{ ansible_env.USER }}"
mode: "0774"
25 changes: 18 additions & 7 deletions chatops_deployment/ansible/roles/volume/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
---
- name: Attach volume to stack host
become: true
ansible.posix.mount:
boot: true
path: /var/stack
src: "{{ ansible_local.terraform.vars.stack_device }}"
state: mounted
fstype: ext4
block:
- name: Try sdb
become: true
ansible.posix.mount:
boot: true
path: /var/stack
src: /dev/sdb
state: mounted
fstype: ext4
rescue:
- name: Try vdb
become: true
ansible.posix.mount:
boot: true
path: /var/stack
src: /dev/vdb
state: mounted
fstype: ext4

- name: Set permissions
become: true
Expand Down
3 changes: 0 additions & 3 deletions chatops_deployment/terraform/modules/compute/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
output "stack_volume_device" {
value = openstack_compute_volume_attach_v2.stack_volume.device
}
3 changes: 0 additions & 3 deletions chatops_deployment/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
output "stack_volume_device" {
value = module.compute.stack_volume_device
}