-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved CentOS 6 and 7 images into contrib - closes #39
- Changed version format of Centos 6/7 images - Added Zabbix agent to the Centos 7 image - Updated GitLab CE image to 9.0.5
- Loading branch information
Showing
16 changed files
with
234 additions
and
141 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
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,37 @@ | ||
#!/bin/bash | ||
|
||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
SCRIPT="${0}" | ||
|
||
log() { | ||
logger -t "${SCRIPT}" "$@" | ||
} | ||
|
||
log "Starting post-deploy configuration of Zabbix agent" | ||
|
||
ZABBIX_AGENT_CONFIG="/etc/zabbix/zabbix_agentd.conf" | ||
ZABBIX_SETUP_DONE="$(mdata-get org.erigones:zabbix_setup_done 2>/dev/null || echo '')" | ||
log "Metadata key org.erigones:zabbix_setup_done value=${ZABBIX_SETUP_DONE}" | ||
|
||
if [[ -z "${ZABBIX_SETUP_DONE}" ]]; then | ||
ZABBIX_IP="$(mdata-get org.erigones:zabbix_ip 2>/dev/null || echo '')" | ||
log "Metadata key org.erigones:zabbix_ip value=${ZABBIX_IP}" | ||
|
||
if [[ -n ${ZABBIX_IP} ]]; then | ||
sed -i "s/^Server=.*/Server=${ZABBIX_IP}/" "${ZABBIX_AGENT_CONFIG}" | ||
sed -i "s/^ServerActive=.*/ServerActive=${ZABBIX_IP}/" "${ZABBIX_AGENT_CONFIG}" | ||
log "Restarting zabbix-agent" | ||
systemctl enable zabbix-agent | ||
systemctl restart zabbix-agent | ||
else | ||
log "Disabling zabbix-agent" | ||
systemctl stop zabbix-agent | ||
systemctl disable zabbix-agent | ||
fi | ||
|
||
log "Setting metadata org.erigones:zabbix_setup_done value=true" | ||
mdata-put org.erigones:zabbix_setup_done true | ||
fi | ||
|
||
log "Finished post-deploy configuration of Zabbix agent" | ||
exit 0 |
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,12 @@ | ||
- fail: msg="Invalid OS; Only CentOS 7 is supported." | ||
when: ansible_distribution != "CentOS" or ansible_distribution_major_version != "7" | ||
|
||
- name: Install additional packages | ||
yum: name="{{ item }}" state=present | ||
with_items: | ||
- man-pages | ||
- vim-enhanced | ||
- screen | ||
|
||
- name: Install /var/lib/rc-scripts/21-zabbix-agent.sh | ||
copy: src=zabbix-agent.sh dest=/var/lib/rc-scripts/21-zabbix-agent.sh mode=0750 owner=root group=root |
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,2 @@ | ||
firewall_allowed_tcp_ports: | ||
- port: 22 |
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,9 @@ | ||
rc_scripts_after: | ||
- zabbix-agent.service | ||
|
||
firewall_allowed_tcp_ports: | ||
- port: 22 | ||
- port: 10050 | ||
|
||
selinux_permissive_domains: | ||
- zabbix_agent_t |
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
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
Oops, something went wrong.