Created
October 31, 2019 21:13
-
-
Save arifcse019/6140f176aa97ebe11441ab00c66c394a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install Prerequirement for CouchDB and then CouchDB itself | |
hosts: "tag_Name_CouchDB_{{env}}:&{{region}}" | |
remote_user: ubuntu | |
become: yes | |
become_user: root | |
vars_files: | |
- "vars/defaults.yml" | |
- "vars/{{ env }}.yml" | |
tasks: | |
- name: Stop the couchdb service | |
become: yes | |
service: | |
name: "couchdb" | |
state: stopped | |
- name: Remove CouchDB from run levels | |
shell: update-rc.d -f couchdb remove | |
- name: Copy the upstart configuration file to run CouchDB as a service | |
copy: src=couchdb.conf dest=/etc/init/couchdb.conf mode=0644 | |
- name: Copy the slack notification script to alert when CouchDB Restarts | |
copy: src=./slack_notification.sh dest=/usr/sbin/slack_notification.sh mode=0774 | |
- name: Copy the upstart configuration file for the slack notification job | |
template: | |
src: couchdb-start-notification.conf.j2 | |
dest: /etc/init/couchdb-start-notification.conf | |
owner: root | |
group: root | |
mode: '0644' | |
- name: Starting using service command | |
become: yes | |
service: | |
name: "couchdb" | |
state: started | |
register: startcdb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment