-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from hos7ein/master
Add supporting of ubuntu hosts
- Loading branch information
Showing
9 changed files
with
72 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[haproxy-server] | ||
[haproxy-servers] | ||
10.10.22.70 |
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 |
---|---|---|
@@ -1,21 +1,11 @@ | ||
- name: Installation haproxystats on CentOS 7.x Server | ||
hosts: haproxy-server | ||
remote_user: root | ||
roles: | ||
- name: install dependency packages | ||
role: roles/install-dependency-package | ||
|
||
- name: install haproxystats | ||
role: roles/install-haproxystats | ||
|
||
- name: create new user | ||
role: roles/create-newuser | ||
|
||
- name: permission setting | ||
role: roles/haproxy-socket-dir-permission | ||
|
||
- name: haproxystats systemd config file | ||
role: roles/systemd-files | ||
|
||
- name: haproxystats config file | ||
role: roles/haproxystats-config-file | ||
# Installation haproxystats | ||
- hosts: haproxy-servers | ||
remote_user: root | ||
gather_facts: False | ||
roles: | ||
- install-dependency-package | ||
- install-haproxystats | ||
- create-newuser | ||
- haproxy-socket-dir-permission | ||
- systemd-files | ||
- haproxystats-config-file |
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
6 changes: 0 additions & 6 deletions
6
contrib/ansible-playbook/roles/haproxy-dir-permission/tasks/main.yml
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
contrib/ansible-playbook/roles/haproxy-socket-dir-permission/tasks/main.yml
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
3 changes: 1 addition & 2 deletions
3
contrib/ansible-playbook/roles/haproxystats-config-file/tasks/main.yml
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
- name: make haproxystats config file | ||
- name: Make haproxystats config file | ||
template: | ||
src: haproxystats.conf.j2 | ||
dest: /etc/haproxystats.conf | ||
backup: yes | ||
|
34 changes: 30 additions & 4 deletions
34
contrib/ansible-playbook/roles/install-dependency-package/tasks/main.yml
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 |
---|---|---|
@@ -1,11 +1,37 @@ | ||
--- | ||
- name : install or update epel repo | ||
- name: Check out distribution and Install python version 2 on Ubuntu hosts | ||
raw: DISTRO=$(awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }') && if [ "$DISTRO" == "ubuntu" ] ; then apt-get -y update && apt-get install -y python-minimal; fi | ||
|
||
- name: enable gather_facts | ||
setup: | ||
|
||
#task on CentOS or RHEL distribution | ||
- name: Install or update EPEL repo | ||
yum: name=epel-release state=latest | ||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' | ||
|
||
- name : install python 3.4 and pip 3 packages | ||
- name: Install python 3.4 and pip3 packages | ||
yum: | ||
pkg: "{{ item }}" | ||
name: "{{ packages }}" | ||
state: latest | ||
with_items: | ||
vars: | ||
packages: | ||
- python34 | ||
- python34-pip | ||
- gcc | ||
- gcc-c++ | ||
- python34-devel | ||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' | ||
|
||
#task on Debian or Ubuntu distribution | ||
- name: Install python 3 and pip3 packages | ||
apt: | ||
name: "{{ packages }}" | ||
state: latest | ||
vars: | ||
packages: | ||
- python3 | ||
- python3-pip | ||
- python3-setuptools | ||
- python-setuptools | ||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' |
26 changes: 24 additions & 2 deletions
26
contrib/ansible-playbook/roles/install-haproxystats/tasks/main.yml
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 |
---|---|---|
@@ -1,5 +1,27 @@ | ||
--- | ||
- name : install haproxystats with pip 3 | ||
- name: Update setuptools by pip3 | ||
pip: | ||
name: haproxystats | ||
name: | ||
- setuptools | ||
state: latest | ||
executable: pip3 | ||
|
||
|
||
- name: Install haproxystats by pip3 | ||
pip: | ||
name: | ||
- pbr | ||
- pandas | ||
- haproxystats | ||
state: latest | ||
executable: pip3 | ||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' | ||
|
||
|
||
- name: Install haproxystats by pip3 | ||
pip: | ||
name: | ||
- haproxystats | ||
state: latest | ||
executable: pip3 | ||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' |
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