Created
November 16, 2015 13:20
-
-
Save proffalken/6ee720d39f2bea79611d to your computer and use it in GitHub Desktop.
Issues with ansible templates
This file contains hidden or 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
TASK: [nsca | Install NSCA Agent] ********************************************* | |
ok: [localhost] | |
TASK: [nsca | Install NSCA Agent] ********************************************* | |
skipping: [localhost] | |
TASK: [nsca | Ensure that the "nagios" user exists] *************************** | |
ok: [localhost] | |
TASK: [nsca | Start and enable the NSCA Service] ****************************** | |
ok: [localhost] | |
TASK: [nsca | Ensure the firewall port is open] ******************************* | |
ok: [localhost] | |
PLAY RECAP ******************************************************************** | |
localhost : ok=17 changed=1 unreachable=0 failed=0 |
This file contains hidden or 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 NSCA Agent | |
apt: name=nsca state=present |
This file contains hidden or 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
--- | |
# tasks file for nsca | |
# include the distro-specific stuff | |
- include: debian.yml | |
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' | |
- include: rhel.yml | |
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' | |
- name: Ensure that the nagios user exists | |
user: name=nagios shell=/bin/bash system=true | |
- name: Install the nsca config file | |
template: "src=nsca.cfg.j2 dest=/etc/nsca.cfg" | |
- name: Start and enable the NSCA Service | |
service: name=nsca state=running enabled=true | |
- name: Ensure the firewall port is open | |
firewalld: | |
port: "{{ nsca_server_port | default('5667') }}/tcp" | |
state: enabled | |
permanent: true | |
immediate: true |
This file contains hidden or 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 NSCA Agent | |
yum: name=nsca state=present |
This file contains hidden or 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
pid_file=/var/run/nsca.pid | |
server_port={{ nsca_server_port|default('5667') }} | |
nsca_user=nagios | |
nsca_group=nogroup | |
debug={{ nsca_debug_level | default('1') }} | |
command_file=/var/run/icinga2/cmd/icinga2.cmd | |
alternate_dump_file=/var/run/icinga2/nsca.dump | |
aggregate_writes=0 | |
append_to_file=0 | |
max_packet_age=30 | |
password={{ nsca_password }} | |
decryption_method=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment