setup nextcloud service

This commit is contained in:
2017-07-15 23:32:27 -04:00
parent 5e8759156f
commit e6900502e4
27 changed files with 418 additions and 196 deletions

View File

@@ -0,0 +1,18 @@
---
# wait random time to start this to offset reboots of individual machines
- pause: seconds={{ 100 | random(1,10) }}
# Send the reboot command
- shell: shutdown -r now
# This pause is mandatory, otherwise the existing control connection gets reused!
- pause: seconds=30
# Now we will run a local 'ansible -m ping' on this host until it returns.
# This works with the existing ansible hosts inventory and so any custom ansible_ssh_hosts definitions are being used
- local_action: shell ansible -u {{ ansible_user_id }} -m ping {{ inventory_hostname }}
register: result
until: result.rc == 0
retries: 30
delay: 10

View File

@@ -21,18 +21,8 @@
command: "letsencrypt certonly --webroot -w /var/www/xai-corp.net -d {{ item }}"
args:
creates: /etc/letsencrypt/live/{{ item }}/cert.pem
with_items:
- xai-corp.net
- www.xai-corp.net
- dkregistry.xai-corp.net
- sql.xai-corp.net
- fs.xai-corp.net
- dkhost.xai-corp.net
- git.xai-corp.net
- dkui.xai-corp.net
- jenkins.xai-corp.net
- logs.xai-corp.net
- tripbuilder.xai-corp.net
with_items: "{{certbot.domains}}"
- name: cron job for renewing certs
cron:

View File

@@ -0,0 +1,4 @@
[program:dd-agent]
command=/root/.datadog-agent/bin/agent start -d
stderr_logfile = /var/log/supervisord/ddagent-stderr.log
stdout_logfile = /var/log/supervisord/ddagent-stdout.log

View File

@@ -0,0 +1,12 @@
---
# handlers/main.yml
# define handlers here
#- name: restart <service>
# service: name=<service> state=restarted
#- name: stop <service>
# service: name=<service> state=stopped
- name: restart supervisor
service: name=supervisor start restarted

View File

@@ -0,0 +1,25 @@
---
# install dd-agent from source
- name: install packages
apt:
state: installed
package: "{{ item }}"
update_cache: yes
cache_valid_time: 3600
with_items:
- python-psutil
- shell: DD_API_KEY=ca0faf176c4aedd4f547ed7cf85615eb sh -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/setup_agent.sh)"
args:
creates: "/root/.datadog-agent/bin/agent"
- name: add agent line to rc.local
lineinfile:
dest: /etc/rc.local
regexp: '^nohup sh /root/.datadog-agent/bin/agent &'
line: 'nohup sh /root/.datadog-agent/bin/agent &'
insertbefore: "^exit 0"
- name: start agent
shell: /root/.datadog-agent/bin/agent start

View File

@@ -14,6 +14,7 @@
- "glusterfs-client"
- xfsprogs
- attr
- virtualbox-guest-additions-iso
#- name: install repo keys
# apt_key:

View File

@@ -15,3 +15,11 @@
force: yes
with_items:
- { src: "/opt/shared/letsencrypt", path: "/etc/letsencrypt" }
- name: setup owncloud cron job
cron:
name: owncloud
state: present
user: www-data
day: "*/15"
job: "curl -k https://xaibox.xai-corp.net/cron.php"

View File

@@ -53,4 +53,6 @@ jenkins IN CNAME dkhost
logs IN CNAME dkhost
dkregistry IN CNAME dkhost
sql IN CNAME dkhost
mysql IN CNAME dkhost
tripbuilder IN CNAME dkhost
xaibox IN CNAME dkhost