From 0e8a36b1a46520de5258057dde98471c62846b26 Mon Sep 17 00:00:00 2001 From: Pi Date: Wed, 13 Mar 2019 13:12:17 -0400 Subject: [PATCH] update nrpe checks add smb credentials all credentials/secrets will eventually go into vault. this is not a huge security concern since none of this is production --- hosts | 2 +- roles/nrpe/files/nrpe_local.cfg | 7 ++++--- roles/smbclient/files/.credentials | 4 ++++ roles/smbclient/tasks/main.yaml | 7 +++++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 roles/smbclient/files/.credentials diff --git a/hosts b/hosts index 621e039..116e316 100755 --- a/hosts +++ b/hosts @@ -31,7 +31,7 @@ sdwcltm6 sdwcltm7 sdwsrvl sdwcltm4 -#192.168.200.163 ansible_user=ubuntu +sdwcltm9 [public] ubuntu-server-1 diff --git a/roles/nrpe/files/nrpe_local.cfg b/roles/nrpe/files/nrpe_local.cfg index a24614d..eb67903 100644 --- a/roles/nrpe/files/nrpe_local.cfg +++ b/roles/nrpe/files/nrpe_local.cfg @@ -3,8 +3,9 @@ ###################################### command[check_test_file_100M]=/usr/bin/sudo /usr/lib/nagios/plugins/check_file_age -w 86400 -c 1570000 -W 50000000 -C 10 -f '/home/pi/Documents/smb/test_file_100M' command[check_test_file_200M]=/usr/bin/sudo /usr/lib/nagios/plugins/check_file_age -w 86400 -c 1570000 -W 100000000 -C 10 -f '/home/pi/Documents/smb/test_file_200M' -command[check_test_file_500M]=/usr/bin/sudo /usr/lib/nagios/plugins/check_file_age -w 86400 -c 1570000 -W 250000000 -C 10 -f '/home/pi/Documents/smb/test_file_500M' -command[check_test_file_1G]=/usr/bin/sudo /usr/lib/nagios/plugins/check_file_age -w 86400 -c 1570000 -W 500000000 -C 10 -f '/home/pi/Documents/smb/test_file_1G' -command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mmcblk0p7 +command[check_test_file_500M]=/usr/bin/sudo /usr/lib/nagios/plugins/check_file_age -w 172800 -c 1570000 -W 250000000 -C 10 -f '/home/pi/Documents/smb/test_file_500M' +command[check_test_file_1G]=/usr/bin/sudo /usr/lib/nagios/plugins/check_file_age -w 172800 -c 1570000 -W 500000000 -C 10 -f '/home/pi/Documents/smb/test_file_1G' +command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p / command[check_mem]=/usr/lib/nagios/plugins/check_mem.pl -u -C -w 85 -c 95 +command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 30% -c 10% diff --git a/roles/smbclient/files/.credentials b/roles/smbclient/files/.credentials new file mode 100644 index 0000000..8c83498 --- /dev/null +++ b/roles/smbclient/files/.credentials @@ -0,0 +1,4 @@ +username=demo +password=Demo123 +domain=DEMO + diff --git a/roles/smbclient/tasks/main.yaml b/roles/smbclient/tasks/main.yaml index ac1b2bc..4c3e78c 100755 --- a/roles/smbclient/tasks/main.yaml +++ b/roles/smbclient/tasks/main.yaml @@ -15,3 +15,10 @@ group: pi mode: a+x tags: smbtraff_script +- name: copy credentials to user directory + copy: + src: "{{ role_path }}/files/.credentials" + dest: /home/pi + owner: pi + group: pi + tags: smbtraff_credentials