forked from kpx-dev/ansible-zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor into reusable includes (#33)
* refactor to re-use redhat tasks for new debian install * refactor tasks into reusable includes * removed extra lines
- Loading branch information
1 parent
e52041e
commit 1359081
Showing
4 changed files
with
61 additions
and
55 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Check if systemd exists | ||
stat: path=/usr/lib/systemd/system/ | ||
register: systemd_check | ||
|
||
- name: Systemd script. | ||
template: src=zookeeper.service.j2 dest=/usr/lib/systemd/system/zookeeper.service | ||
when: systemd_check.stat.exists == true | ||
notify: | ||
- Restart zookeeper |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
- file: path=/opt/src state=directory | ||
- file: path={{zookeeper_dir}} state=directory | ||
|
||
- name: Download zookeeper version. | ||
get_url: url={{zookeeper_url}} dest=/opt/src/zookeeper-{{zookeeper_version}}.tar.gz | ||
tags: bootstrap | ||
|
||
- name: Unpack tarball. | ||
command: tar zxf /opt/src/zookeeper-{{zookeeper_version}}.tar.gz --strip-components=1 chdir={{zookeeper_dir}} creates={{zookeeper_dir}}/bin | ||
tags: bootstrap | ||
|
||
- group: name=zookeeper system=yes | ||
- user: name=zookeeper group=zookeeper system=yes | ||
|
||
- name: Change ownership on zookeeper directory. | ||
file: path={{zookeeper_dir}} state=directory owner=zookeeper group=zookeeper recurse=yes | ||
tags: bootstrap | ||
|
||
- name: Create zookeeper data folder. | ||
file: path={{data_dir}} state=directory recurse=yes owner=zookeeper group=zookeeper | ||
tags: bootstrap | ||
|
||
- name: Create zookeeper logs folder. | ||
file: path={{log_dir}} state=directory recurse=yes owner=zookeeper group=zookeeper | ||
tags: bootstrap | ||
|
||
- name: Write myid file. | ||
template: src=myid.j2 dest={{data_dir}}/myid owner=zookeeper group=zookeeper | ||
tags: deploy | ||
notify: | ||
- Restart zookeeper | ||
|
||
- name: Configure zookeeper | ||
template: src=zoo.cfg.j2 dest={{ zookeeper_dir }}/conf/zoo.cfg owner=zookeeper group=zookeeper | ||
tags: deploy | ||
notify: | ||
- Restart zookeeper |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Check if /etc/init exists | ||
stat: path=/etc/init/ | ||
register: etc_init | ||
|
||
- name: Upstart script. | ||
template: src=zookeeper.conf.j2 dest=/etc/init/zookeeper.conf | ||
when: etc_init.stat.exists == true | ||
notify: | ||
- Restart zookeeper |