Browse Source

playbooks voor tivoli client en rugcms uitrol toegevoegd

master
G.J.C. Strikwerda 4 years ago
parent
commit
e2f5caa305
  1. 5
      playbooks/rugcms-frontend-uitrol/ansible.cfg
  2. 55
      playbooks/rugcms-frontend-uitrol/hosts
  3. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/Lib_Utils-1.00-09.noarch.rpm
  4. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/MegaCli-8.04.07-1.noarch.rpm
  5. 227
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/firewall.sh
  6. 209
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/megaclisas-status
  7. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa21
  8. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa22
  9. 9
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa23
  10. 9
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa24
  11. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp21
  12. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp22
  13. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp23
  14. 11
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp24
  15. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp25
  16. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp26
  17. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-ft21
  18. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/nagios.tar.gz
  19. 47
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/profile_rugcms
  20. 3
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/resolv.conf
  21. 139
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/sshd_config
  22. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/yum_debug_dump.txt.gz
  23. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/.main.yml.swp
  24. 34
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/copy-files.yml
  25. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/copy-firewall.yml
  26. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/disable-selinux.yml
  27. 9
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/docker-netdata.yml
  28. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/ger-user.yml
  29. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-docker-py.yml
  30. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-epel.yml
  31. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-ntp.yml
  32. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-yum-utils.yml
  33. 21
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/main.yml
  34. 27
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/mega-cli.yml
  35. 42
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/nagios-client.yml
  36. 3
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-group.yml
  37. 7
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-keys.yml
  38. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-profile.yml
  39. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-user.yml
  40. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/run-firewall.yml
  41. 4
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/start-ntp.yml
  42. 14
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/start-services.yml
  43. 15
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/stealth-client.yml
  44. 3
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/stop-firewalld.yml
  45. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/upgrade.yml
  46. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/Lib_Utils-1.00-09.noarch.rpm
  47. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/MegaCli-8.04.07-1.noarch.rpm
  48. 227
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/firewall.sh
  49. 209
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/megaclisas-status
  50. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fa21
  51. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fa22
  52. 9
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fa23
  53. 9
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fa24
  54. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fp21
  55. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fp22
  56. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fp23
  57. 11
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fp24
  58. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fp25
  59. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-fp26
  60. 10
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-ft21
  61. 16
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/motd.cms-ft22
  62. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/nagios.tar.gz
  63. 47
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/profile_rugcms
  64. 3
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/resolv.conf
  65. 139
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/sshd_config
  66. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/yum_debug_dump.txt.gz
  67. BIN
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/.main.yml.swp
  68. 34
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/copy-files.yml
  69. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/copy-firewall.yml
  70. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/disable-selinux.yml
  71. 9
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/docker-netdata.yml
  72. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/ger-user.yml
  73. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/install-docker-py.yml
  74. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/install-epel.yml
  75. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/install-ntp.yml
  76. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/install-yum-utils.yml
  77. 21
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/main.yml
  78. 27
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/mega-cli.yml
  79. 42
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/nagios-client.yml
  80. 3
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/rugcms-group.yml
  81. 7
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/rugcms-keys.yml
  82. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/rugcms-profile.yml
  83. 6
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/rugcms-user.yml
  84. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/run-firewall.yml
  85. 4
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/start-ntp.yml
  86. 14
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/start-services.yml
  87. 15
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/stealth-client.yml
  88. 3
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/stop-firewalld.yml
  89. 1
      playbooks/rugcms-frontend-uitrol/roles/frontend_test/tasks/upgrade.yml
  90. 8
      playbooks/rugcms-frontend-uitrol/rugcms-frontend_acc_prod.yml
  91. 8
      playbooks/rugcms-frontend-uitrol/rugcms-frontend_test.yml
  92. 5
      playbooks/tivoli-client/ansible.cfg
  93. 8
      playbooks/tivoli-client/backup-client.yml
  94. 4
      playbooks/tivoli-client/hosts
  95. 38
      playbooks/tivoli-client/tivo/README.md
  96. 2
      playbooks/tivoli-client/tivo/defaults/main.yml
  97. BIN
      playbooks/tivoli-client/tivo/files/8.1.4.0-TIV-TSMBAC-LinuxX86.tar
  98. 267
      playbooks/tivoli-client/tivo/files/README.htm
  99. 267
      playbooks/tivoli-client/tivo/files/README_api.htm
  100. BIN
      playbooks/tivoli-client/tivo/files/TIVsm-API64.x86_64.rpm
  101. Some files were not shown because too many files have changed in this diff Show More

5
playbooks/rugcms-frontend-uitrol/ansible.cfg

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
[defaults]
hostfile = hosts
remote_user = root
private_key_file = /home/ger/.ssh/id_dsa
host_key_checking = false

55
playbooks/rugcms-frontend-uitrol/hosts

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
[rugcms]
cms-ft11 ansible_host=cms-ft11.service.rug.nl ansible_port=22
cms-ft12 ansible_host=cms-ft12.service.rug.nl ansible_port=22
cms-ft21 ansible_host=cms-ft21.service.rug.nl ansible_port=22
cms-ft22 ansible_host=cms-ft22.service.rug.nl ansible_port=22
cms-fa11 ansible_host=cms-fa11.service.rug.nl ansible_port=22
cms-fa12 ansible_host=cms-fa12.service.rug.nl ansible_port=22
cms-fa13 ansible_host=cms-fa13.service.rug.nl ansible_port=22
cms-fa14 ansible_host=cms-fa14.service.rug.nl ansible_port=22
cms-fp11 ansible_host=cms-fp11.service.rug.nl ansible_port=22
cms-fp12 ansible_host=cms-fp12.service.rug.nl ansible_port=22
cms-fp13 ansible_host=cms-fp13.service.rug.nl ansible_port=22
cms-fp14 ansible_host=cms-fp14.service.rug.nl ansible_port=22
cms-fp15 ansible_host=cms-fp15.service.rug.nl ansible_port=22
cms-fp16 ansible_host=cms-fp16.service.rug.nl ansible_port=22
cms-fa21 ansible_host=cms-fa21.service.rug.nl ansible_port=22
cms-fa22 ansible_host=cms-fa22.service.rug.nl ansible_port=22
cms-fa23 ansible_host=cms-fa23.service.rug.nl ansible_port=22
cms-fa24 ansible_host=cms-fa24.service.rug.nl ansible_port=22
cms-fp21 ansible_host=cms-fp21.service.rug.nl ansible_port=22
cms-fp22 ansible_host=cms-fp22.service.rug.nl ansible_port=22
cms-fp23 ansible_host=cms-fp23.service.rug.nl ansible_port=22
cms-fp24 ansible_host=cms-fp24.service.rug.nl ansible_port=22
cms-fp25 ansible_host=cms-fp25.service.rug.nl ansible_port=22
cms-fp26 ansible_host=cms-fp26.service.rug.nl ansible_port=22
[acc-new]
cms-fa[21:24]
[prod]
cms-fp[21:26]
[test]
cms-ft[21:22]
[old-test]
cms-ft[11:12]
[old-acc]
cms-fa[11:14]
[old-prod]
cms-fp[11:16]
[new]
cms-fa[21:24]
cms-fp[21:26]

BIN
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/Lib_Utils-1.00-09.noarch.rpm

Binary file not shown.

BIN
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/MegaCli-8.04.07-1.noarch.rpm

Binary file not shown.

227
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/firewall.sh

@ -0,0 +1,227 @@ @@ -0,0 +1,227 @@
#!/bin/bash
# prevent SYNC-floods:
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
# initialize:
iptables -F
iptables -X
iptables -Z
# config default policy's:
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -N LOGDROP
iptables -A LOGDROP -j LOG
iptables -A LOGDROP -j DROP
# kernel tweaks:
/bin/echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
/bin/echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
/bin/echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
/bin/echo 1 > /proc/sys/net/ipv4/conf/all/log_martians
/bin/echo 0 > /proc/sys/net/ipv4/ip_forward
# allow loopback:
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# allow asds.id.rug.nl
iptables -A INPUT -i br0 -s 129.125.2.50 -j ACCEPT
iptables -A OUTPUT -o br0 -d 129.125.2.50 -j ACCEPT
# allow vlan933:
iptables -A INPUT -i bond0.933 -j ACCEPT
iptables -A OUTPUT -o bond0.933 -j ACCEPT
# allow vlan934:
iptables -A INPUT -i bond0.934 -j ACCEPT
iptables -A OUTPUT -o bond0.934 -j ACCEPT
#allow outbound to databases:
iptables -A INPUT -p tcp -s 129.125.36.182 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.182 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.183 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.183 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.184 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.184 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.185 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.185 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.186 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.186 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.187 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.187 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.188 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.188 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.141 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.141 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.142 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.142 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.143 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.143 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.144 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.144 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.148 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.148 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.149 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.149 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.150 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.150 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.50.147 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.50.147 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.71 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.71 -j ACCEPT
# allow munin-statieken-server:
iptables -A INPUT -p tcp -s 129.125.50.91 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.50.91 -j ACCEPT
# allow agenda:
iptables -A INPUT -p tcp -s 129.125.2.116 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.2.116 -j ACCEPT
# allow imap.google.com:
iptables -A INPUT -p tcp -s 74.125.136/24 -j ACCEPT
iptables -A OUTPUT -p tcp -d 74.125.136/24 -j ACCEPT
# allow imap.rug.nl:
iptables -A INPUT -p tcp -s 129.125.2.81/32 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.2.81/32 -j ACCEPT
# allow more google:
iptables -A INPUT -p tcp -s 173.194.65.0/24 -j ACCEPT
iptables -A OUTPUT -p tcp -d 173.194.65.0/24 -j ACCEPT
# new tcp packets sync packets:
iptables -A INPUT -i br0 -p tcp ! --syn -m state --state NEW -j DROP
# refuse loopback pacts incoming eth0:
iptables -A INPUT -i br0 -d 127.0.0.0/8 -j DROP
# allow dns outbound to/from DNS server:
iptables -A INPUT -i br0 -p udp --sport 53 -j ACCEPT
iptables -A OUTPUT -o br0 -p udp --dport 53 -j ACCEPT
# allow www outbound to 80:
iptables -A INPUT -i br0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow www outbound to 443:
iptables -A INPUT -i br0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow smtp outbound:
iptables -A INPUT -i br0 -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow ssh from BWP:
iptables -A INPUT -i br0 -p tcp -s 129.125.249.0/24 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp -d 129.125.249.0/24 -m state --state ESTABLISHED -j ACCEPT
# log/drop the rest:
iptables -A INPUT -i br0 -s 129.125.0.0/16 -d 129.125.36.121/32 -j LOGDROP
#zabbix monitorings
iptables -A INPUT -i br0 -s 129.125.50.238 -j ACCEPT
iptables -A OUTPUT -o br0 -d 129.125.50.238 -j ACCEPT
# allow 9080 inbound:
iptables -A INPUT -i br0 -p tcp --dport 9080 -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp --sport 9080 -j ACCEPT
# allow 2222 inbound:
iptables -A INPUT -i br0 -p tcp -s 129.125.249.0/24 --dport 2222 -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp -d 129.125.249.0/24 --sport 2222 -j ACCEPT
# inbound gadgets:
iptables -A INPUT -i br0 -p tcp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
# allow from operator:
iptables -A INPUT -i br0 -s 129.125.50.41/32 -j ACCEPT
iptables -A OUTPUT -o br0 -d 129.125.50.41/32 -j ACCEPT
# allow from/to ldap:
iptables -A INPUT -i br0 -s 129.125.68.50/32 -j ACCEPT
iptables -A OUTPUT -o br0 -d 129.125.68.50/32 -j ACCEPT
# ldaps outbound:
iptables -A INPUT -i br0 -p tcp --sport 636 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp --dport 636 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow nfs:
iptables -A INPUT -i br0 -s 129.125.50.171/32 -j ACCEPT
iptables -A OUTPUT -o br0 -d 129.125.50.171/32 -j ACCEPT
# allow ntp
iptables -A INPUT -i br0 -p tcp --sport 123 -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp --dport 123 -j ACCEPT
iptables -A INPUT -i br0 -p udp --sport 123 -j ACCEPT
iptables -A OUTPUT -o br0 -p udp --dport 123 -j ACCEPT
# allow charanga:
iptables -A INPUT -i br0 -p tcp -s 129.125.60.94/32 --dport 22 -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp -d 129.125.60.94/32 --sport 22 -j ACCEPT
# charanga 129.125.60.94 port 2222:
iptables -A INPUT -i br0 -p tcp -s 129.125.60.94/32 --dport 2222 -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp -d 129.125.60.94/32 --sport 2222 -j ACCEPT
# allow imaps:
iptables -A INPUT -p tcp --sport 993 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 993 -j ACCEPT
# Flush & default
ip6tables -F INPUT
ip6tables -F OUTPUT
ip6tables -F FORWARD
# setup log-chain:
ip6tables -N LOGREJECT
ip6tables -A LOGREJECT -j LOG
ip6tables -A LOGREJECT -j REJECT
# Set the default policy to drop
ip6tables -P INPUT DROP
ip6tables -P OUTPUT DROP
ip6tables -P FORWARD DROP
# rules:
ip6tables -A INPUT -i lo -j ACCEPT
ip6tables -A INPUT -j REJECT
ip6tables -A OUTPUT -j REJECT
# allow ganglia-statieken-server:
iptables -A INPUT -p tcp -s 129.125.60.89 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.60.89 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.191 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.191 -j ACCEPT
# open up port 9100 prometues:
iptables -A INPUT -i br0 -p tcp -s 129.125.2.233/32 --dport 9100 -j ACCEPT
iptables -A OUTPUT -o br0 -p tcp -d 129.125.2.233/32 --sport 9100 -j ACCEPT
# allow icmp:
iptables -A INPUT -p icmp -j ACCEPT
iptables -A OUTPUT -p icmp -j ACCEPT

209
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/megaclisas-status

@ -0,0 +1,209 @@ @@ -0,0 +1,209 @@
#!/usr/bin/python
import os
import re
import sys
binarypath = "/usr/sbin/megacli"
if len(sys.argv) > 2:
print 'Usage: megaclisas-status [--nagios]'
sys.exit(1)
nagiosmode=False
nagiosoutput=''
nagiosgoodarray=0
nagiosbadarray=0
nagiosgooddisk=0
nagiosbaddisk=0
# Check command line arguments to enable nagios or not
if len(sys.argv) > 1:
if sys.argv[1] == '--nagios':
nagiosmode=True
else:
print 'Usage: megaclisas-status [-nagios]'
sys.exit(1)
# Check binary exists (and +x), if not print an error message
# or return UNKNOWN nagios error code
if os.path.exists(binarypath) and os.access(binarypath, os.X_OK):
pass
else:
if nagiosmode:
print 'UNKNOWN - Cannot find '+binarypath
else:
print 'Cannot find '+binarypath+'. Please install it.'
sys.exit(3)
# Get command output
def getOutput(cmd):
output = os.popen(cmd)
lines = []
for line in output:
if not re.match(r'^$',line.strip()):
lines.append(line.strip())
return lines
def returnControllerNumber(output):
for line in output:
if re.match(r'^Controller Count.*$',line.strip()):
return int(line.split(':')[1].strip().strip('.'))
def returnControllerModel(output):
for line in output:
if re.match(r'^Product Name.*$',line.strip()):
return line.split(':')[1].strip()
def returnArrayNumber(output):
i = 0
for line in output:
if re.match(r'^Number of Virtual (Disk|Drive).*$',line.strip()):
i = line.strip().split(':')[1].strip()
return i
def returnArrayInfo(output,controllerid,arrayid):
id = 'c'+str(controllerid)+'u'+str(arrayid)
operationlinennumber = False
linenumber = 0
for line in output:
if re.match(r'Number Of Drives\s*((per span))?:.*[0-9]+$',line.strip()):
ldpdcount = line.split(':')[1].strip()
if re.match(r'Span Depth *:.*[0-9]+$',line.strip()):
spandepth = line.split(':')[1].strip()
if re.match(r'^RAID Level\s*:.*$',line.strip()):
raidlevel = line.strip().split(':')[1].split(',')[0].split('-')[1].strip()
type = 'RAID' + raidlevel
if re.match(r'^Size\s*:.*$',line.strip()):
# Size reported in MB
if re.match(r'^.*MB$',line.strip().split(':')[1]):
size = line.strip().split(':')[1].strip('MB').strip()
size = str(int(round((float(size) / 1000))))+'G'
# Size reported in TB
elif re.match(r'^.*TB$',line.strip().split(':')[1]):
size = line.strip().split(':')[1].strip('TB').strip()
size = str(int(round((float(size) * 1000))))+'G'
# Size reported in GB (default)
else:
size = line.strip().split(':')[1].strip('GB').strip()
size = str(int(round((float(size)))))+'G'
if re.match(r'^State\s*:.*$',line.strip()):
state = line.strip().split(':')[1].strip()
if re.match(r'^Ongoing Progresses\s*:.*$',line.strip()):
operationlinennumber = linenumber
linenumber += 1
if operationlinennumber:
inprogress = output[operationlinennumber+1]
else:
inprogress = 'None'
if ldpdcount and (int(spandepth) > 1):
ldpdcount = int(ldpdcount) * int(spandepth)
if int(raidlevel) < 10:
type = type + "0"
return [id,type,size,state,inprogress]
def returnDiskInfo(output,controllerid):
arrayid = False
diskid = False
table = []
state = 'undef'
model = 'undef'
for line in output:
if re.match(r'^Virtual (Disk|Drive): [0-9]+.*$',line.strip()):
arrayid = line.split('(')[0].split(':')[1].strip()
if re.match(r'Firmware state: .*$',line.strip()):
state = line.split(':')[1].strip()
if re.match(r'Inquiry Data: .*$',line.strip()):
model = line.split(':')[1].strip()
model = re.sub(' +', ' ', model)
if re.match(r'PD: [0-9]+ Information.*$',line.strip()):
diskid = line.split()[1].strip()
if arrayid != False and state != 'undef' and model != 'undef' and diskid != False:
table.append([str(arrayid), str(diskid), state, model])
state = 'undef'
model = 'undef'
return table
cmd = binarypath+' -adpCount -NoLog'
output = getOutput(cmd)
controllernumber = returnControllerNumber(output)
bad = False
# List available controller
if not nagiosmode:
print '-- Controller informations --'
print '-- ID | Model'
controllerid = 0
while controllerid < controllernumber:
cmd = binarypath+' -AdpAllInfo -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
controllermodel = returnControllerModel(output)
print 'c'+str(controllerid)+' | '+controllermodel
controllerid += 1
print ''
controllerid = 0
if not nagiosmode:
print '-- Arrays informations --'
print '-- ID | Type | Size | Status | InProgress'
while controllerid < controllernumber:
arrayid = 0
cmd = binarypath+' -LdGetNum -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
arraynumber = returnArrayNumber(output)
while arrayid < int(arraynumber):
cmd = binarypath+' -LDInfo -l'+str(arrayid)+' -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
arrayinfo = returnArrayInfo(output,controllerid,arrayid)
if not nagiosmode:
print arrayinfo[0]+' | '+arrayinfo[1]+' | '+arrayinfo[2]+' | '+arrayinfo[3]+' | '+arrayinfo[4]
if not arrayinfo[3] == 'Optimal':
bad = True
nagiosbadarray=nagiosbadarray+1
else:
nagiosgoodarray=nagiosgoodarray+1
arrayid += 1
controllerid += 1
if not nagiosmode:
print ''
if not nagiosmode:
print '-- Disks informations'
print '-- ID | Model | Status'
controllerid = 0
while controllerid < controllernumber:
arrayid = 0
cmd = binarypath+' -LDInfo -lall -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
cmd = binarypath+' -LdPdInfo -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
arraydisk = returnDiskInfo(output,controllerid)
for array in arraydisk:
if not array[2] == 'Online' and not array[2] == 'Online, Spun Up':
bad=True
nagiosbaddisk=nagiosbaddisk+1
else:
nagiosgooddisk=nagiosgooddisk+1
if not nagiosmode:
print 'c'+str(controllerid)+'u'+array[0]+'p'+array[1]+' | '+array[3]+' | '+array[2]
controllerid += 1
if nagiosmode:
if bad:
print 'RAID ERROR - Arrays: OK:'+str(nagiosgoodarray)+' Bad:'+str(nagiosbadarray)+' - Disks: OK:'+str(nagiosgooddisk)+' Bad:'+str(nagiosbaddisk)
sys.exit(2)
else:
print 'RAID OK - Arrays: OK:'+str(nagiosgoodarray)+' Bad:'+str(nagiosbadarray)+' - Disks: OK:'+str(nagiosgooddisk)+' Bad:'+str(nagiosbaddisk)
else:
if bad:
print '\nThere is at least one disk/array in a NOT OPTIMAL state.'
sys.exit(1)

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa21

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ ________ ____
____ _____ ______ _/ ____\____ \_____ \/_ |
_/ ___\ / \ / ___/ ______ \ __\\__ \ / ____/ | |
\ \___| Y Y \\___ \ /_____/ | | / __ \_/ \ | |
\___ >__|_| /____ > |__| (____ /\_______ \|___|
\/ \/ \/ \/ \/

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa22

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ ________ ________
____ _____ ______ _/ ____\____ \_____ \\_____ \
_/ ___\ / \ / ___/ ______ \ __\\__ \ / ____/ / ____/
\ \___| Y Y \\___ \ /_____/ | | / __ \_/ \/ \
\___ >__|_| /____ > |__| (____ /\_______ \_______ \
\/ \/ \/ \/ \/ \/

9
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa23

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
_____ ________ ________
____ _____ ______ _/ ____\____ \_____ \ \_____ \
_/ ___\ / \ / ___/ ______ \ __\\__ \ / ____/ _(__ <
\ \___| Y Y \\___ \ /_____/ | | / __ \_/ \ / \
\___ >__|_| /____ > |__| (____ /\_______ \/______ /
\/ \/ \/ \/ \/ \/

9
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fa24

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
_____ ________ _____
____ _____ ______ _/ ____\____ \_____ \ / | |
_/ ___\ / \ / ___/ ______ \ __\\__ \ / ____/ / | |_
\ \___| Y Y \\___ \ /_____/ | | / __ \_/ \/ ^ /
\___ >__|_| /____ > |__| (____ /\_______ \____ |
\/ \/ \/ \/ \/ |__|

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp21

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ ________ ____
____ _____ ______ _/ ____\_____ \_____ \/_ |
_/ ___\ / \ / ___/ ______ \ __\\____ \ / ____/ | |
\ \___| Y Y \\___ \ /_____/ | | | |_> > \ | |
\___ >__|_| /____ > |__| | __/\_______ \|___|
\/ \/ \/ |__| \/

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp22

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ ________ ________
____ _____ ______ _/ ____\_____ \_____ \\_____ \
_/ ___\ / \ / ___/ ______ \ __\\____ \ / ____/ / ____/
\ \___| Y Y \\___ \ /_____/ | | | |_> > \/ \
\___ >__|_| /____ > |__| | __/\_______ \_______ \
\/ \/ \/ |__| \/ \/

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp23

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ ________ ________
____ _____ ______ _/ ____\_____ \_____ \ \_____ \
_/ ___\ / \ / ___/ ______ \ __\\____ \ / ____/ _(__ <
\ \___| Y Y \\___ \ /_____/ | | | |_> > \ / \
\___ >__|_| /____ > |__| | __/\_______ \/______ /
\/ \/ \/ |__| \/ \/

11
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp24

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
_____ ________ _____
____ _____ ______ _/ ____\_____ \_____ \ / | |
_/ ___\ / \ / ___/ ______ \ __\\____ \ / ____/ / | |_
\ \___| Y Y \\___ \ /_____/ | | | |_> > \/ ^ /
\___ >__|_| /____ > |__| | __/\_______ \____ |
\/ \/ \/ |__| \/ |__|

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp25

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ ________ .________
____ _____ ______ _/ ____\_____ \_____ \ | ____/
_/ ___\ / \ / ___/ ______ \ __\\____ \ / ____/ |____ \
\ \___| Y Y \\___ \ /_____/ | | | |_> > \ / \
\___ >__|_| /____ > |__| | __/\_______ \/______ /
\/ \/ \/ |__| \/ \/

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-fp26

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ ________ ________
____ _____ ______ _/ ____\_____ \_____ \/ _____/
_/ ___\ / \ / ___/ ______ \ __\\____ \ / ____/ __ \
\ \___| Y Y \\___ \ /_____/ | | | |_> > \ |__\ \
\___ >__|_| /____ > |__| | __/\_______ \_____ /
\/ \/ \/ |__| \/ \/

10
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/motd.cms-ft21

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
_____ __ ________ ____
____ _____ ______ _/ ____\/ |_\_____ \/_ |
_/ ___\ / \ / ___/ ______ \ __\\ __\/ ____/ | |
\ \___| Y Y \\___ \ /_____/ | | | | / \ | |
\___ >__|_| /____ > |__| |__| \_______ \|___|
\/ \/ \/ \/

BIN
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/nagios.tar.gz

Binary file not shown.

47
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/profile_rugcms

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
EDITOR=nano
export EDITOR
JAVA_HOME=$HOME/software/java
export JAVA_HOME
PATH=$JAVA_HOME/bin:/usr/local/bin:/usr/bin:/usr/ccs/bin:$PATH
export PATH
RUGCMS_CLASSPATH=\
$HOME/software/tomcat/lib/*:\
$HOME/servers/tomcat-common/lib/*:\
$HOME/servers/ucms-common/lib/ucms/*:\
$HOME/servers/ucms-common/lib/xml/*:\
$HOME/servers/ucms-common/lib/jackrabbit/*:\
$HOME/servers/ucms-common/lib/apache/*:\
$HOME/servers/ucms-common/lib/google/*:\
$HOME/servers/ucms-common/lib/*
export RUGCMS_CLASSPATH
source $HOME/scripts/setClusterAndNode.sh
if [[ $CLUSTER == 'test' ]]; then
PS1=$'\\[\\e[32;1m\\]\\u@\\h (\\w) : \\[\\e[0m\\]'
elif [[ $CLUSTER == 'acceptation' ]]; then
PS1=$'\\[\\e[33;1m\\]\\u@\\h (\\w) : \\[\\e[0m\\]'
elif [[ $CLUSTER == 'production' ]]; then
PS1=$'\\[\\e[31m\\]\\u@\\h (\\w) : \\[\\e[0m\\]'
else
PS1=$'\\[\\e[35;1m\\]\\u@\\h (\\w) : \\[\\e[0m\\]'
fi
export PS1

3
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/resolv.conf

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
search service.rug.nl
nameserver 129.125.4.6
nameserer 8.8.8.8

139
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/sshd_config

@ -0,0 +1,139 @@ @@ -0,0 +1,139 @@
# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin without-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
#KerberosUseKuserok yes
# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
#GSSAPIEnablek5users no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several
# problems.
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server

BIN
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/files/yum_debug_dump.txt.gz

Binary file not shown.

BIN
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/.main.yml.swp

Binary file not shown.

34
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/copy-files.yml

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
- copy:
src: files/motd.{{ ansible_hostname }}
dest: /etc/motd
owner: root
group: root
mode: 0644
- copy:
src: files/hosts
dest: /etc/hosts
owner: root
group: root
mode: 0644
- copy:
src: files/sshd_config
dest: /etc/ssh/sshd_config
owner: root
group: root
mode: 0600
- copy:
src: files/resolv.conf
dest: /etc/resolv.conf
owner: root
group: root
mode: 0644
- copy:
src: files/yum_debug_dump.txt.gz
dest: /root/yum_debug_dump.txt.gz
owner: root
group: root
mode: 0600

6
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/copy-firewall.yml

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
- copy:
src: files/firewall.sh
dest: /root/firewall/firewall.sh
owner: root
group: root
mode: 0700

1
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/disable-selinux.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
- selinux: state=disabled

9
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/docker-netdata.yml

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
- docker_container:
name: netdata
image: titpetric/netdata
network_mode: host
hostname: "{{ ansible_hostname }}"
capabilities: SYS_PTRACE
state: started
volumes:
- /sys:/host/sys:ro

6
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/ger-user.yml

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
- user:
name: ger
comment: "ger user"
state: present
group: rugcms
home: /home/ger

1
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-docker-py.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
- yum: name=python-docker-py state=latest

1
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-epel.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
- yum: name=epel-release state=latest

1
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-ntp.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
- yum: name=ntp state=latest

1
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/install-yum-utils.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
- yum: name=yum-utils state=latest

21
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/main.yml

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
- include: rugcms-group.yml
- include: rugcms-user.yml
- include: rugcms-keys.yml
- include: rugcms-profile.yml
- include: rugcms-password.yml
- include: stealth-client.yml
- include: install-epel.yml
- include: install-ntp.yml
- include: install-yum-utils.yml
- include: install-docker-py.yml
- include: disable-selinux.yml
- include: start-ntp.yml
- include: stop-firewalld.yml
- include: copy-firewall.yml
- include: run-firewall.yml
- include: nagios-client.yml
- include: mega-cli.yml
- include: copy-files.yml
- include: start-services.yml
- include: docker-netdata.yml
- include: upgrade.yml

27
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/mega-cli.yml

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
- copy:
src: files/Lib_Utils-1.00-09.noarch.rpm
dest: /tmp/Lib_Utils-1.00-09.noarch.rpm
- yum:
name: /tmp/Lib_Utils-1.00-09.noarch.rpm
state: present
- copy:
src: files/MegaCli-8.04.07-1.noarch.rpm
dest: /tmp/MegaCli-8.04.07-1.noarch.rpm
- yum:
name: /tmp/MegaCli-8.04.07-1.noarch.rpm
state: present
- copy:
src: files/megaclisas-status
dest: /usr/sbin/megaclisas-status
owner: root
group: root
mode: 0700
- file:
src: /opt/MegaRAID/MegaCli/MegaCli64
dest: /usr/sbin/megacli
state: link

42
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/nagios-client.yml

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
- file: path=/nagios state=directory
- unarchive:
src: files/nagios.tar.gz
dest: /nagios
- cron:
name: "check disk full"
minute: "00,10,20,30,40,50"
hour: "*"
job: "/nagios/cron/check_disk"
- cron:
name: "check disk ok"
minute: "00,10,20,30,40,50"
hour: "*"
job: "/nagios/cron/check_disks"
- cron:
name: "check firewall"
minute: "00,10,20,30,40,50"
hour: "*"
job: "/nagios/cron/check_iptables"
- replace:
path: /nagios/cron/check_iptables
regexp: 'HOSTNAME="cms-fa11.service.rug.nl"'
replace: 'HOSTNAME="{{ ansible_hostname }}.service.rug.nl"'
backup: yes
- replace:
path: /nagios/cron/check_disk
regexp: 'HOSTNAME="cms-fa11.service.rug.nl"'
replace: 'HOSTNAME="{{ ansible_hostname }}.service.rug.nl"'
backup: yes
- replace:
path: /nagios/cron/check_disks
regexp: 'HOSTNAME="cms-fa11.service.rug.nl"'
replace: 'HOSTNAME="{{ ansible_hostname }}.service.rug.nl"'
backup: yes

3
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-group.yml

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
- group:
name: rugcms
state: present

7
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-keys.yml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
- authorized_key:
user: rugcms
key: '{{ item }}'
state: present
with_items:
- 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAz/4D/jhUycyYS8gOrQDs+BqK+MLzfB9kb60W9zGTs9KigKGUOtvZ78mb1F2+ouy/uQUbOO4MoUu+fOzSlSE56GdyTSc/RsLaoHde2aRalXnRf55tuIVgv6MNG7siZt1i4iDhm/uql8nzc7m0Ompr9XXLXOQ0ZGFPViLLYyRcLOc= r.m.uittenbroek@rug.nl'
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoRM/8ItzD87bvO6WVwDS83mkLUv0fo1dUxBzGB0w9j+a4vtUbcGm13TXp6zIS6zZqj09QD8jznO1OE92tC1axjuwENbAi7WiqaFMJdqB6MLN4Fxo4xa5LaadDTFbd4yLI1lzheowfPvFypUW90L4ToEkKkvgp+r+4C7BrLLUTzksS3PzBB2jp25XimdbxQvbZS74RdEa4O1Xqz0A4+FbM9r90OIJGrexVTKb2jpQk3bhTIpCXDkRldA1PLYSPoUAmCViGPoHCoyNbtZj8MWDjOKH/Ut/WXg5z60JfFqHazkHsQiJ9YkgUk2zy/7cjl5Pl8DVkPp79c/F5YFw492XN rugcms@charanga'

6
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-profile.yml

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
- copy:
src: files/profile_rugcms
dest: /local_disk/.profile
owner: rugcms
group: rugcms
mode: 0700

6
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/rugcms-user.yml

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
- user:
name: rugcms
comment: "rugcms user"
state: present
group: rugcms
home: /local_disk

1
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/run-firewall.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
- script: chdir=/root/firewall firewall.sh

4
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/start-ntp.yml

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
- systemd:
name: ntpd.service
state: started
enabled: yes

14
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/start-services.yml

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
- systemd:
name: sshd.service
state: started
enabled: yes
- systemd:
name: postfix.service
state: started
enabled: yes
- systemd:
name: docker.service
state: started
enabled: yes

15
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/stealth-client.yml

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
- group:
name: kees
state: present
- user:
name: kees
comment: "stealth user"
state: present
group: kees
home: /home/kees
- authorized_key:
user: kees
key: 'ssh-dss AAAAB3NzaC1kc3MAAACBALg7GbHKk2jYPNXUgW69AKKnCALjroTtwCA0bt4zde1mavYNoQK8JY/pe4BSOQtsyo3JECYzmAZwoNbq8nJCh8ORf5tKs8njEykZ0n7BVWtCT/jh9EFPTFhFK864TdFVCvwtIafAL4kEVNvJ0wrJYa1mN/ds03HWliv+3Shj6x0dAAAAFQDxlwgId3zlrXiCfk3ciAHN5b2ScwAAAIEArZ3/Hg7FECh5Fjf7lnBQZW7sjG5OLZRJIZlj2/jYnvIRUrsN2XmebwO4Q5q7g7FLWlfbg+x2Lmv1OWf/zGd3U6aAx8M+d+nTWDtWpQNvcE99HlfOs9Q4Rzxx6ZOyaZn57lCva/nCmLe0DTPVB8rvocMmqe1r3n7/KgxxKttbWRUAAACAfH2y4JPt2AcVdHnHiibpQBtxK/9m6AEjsB/g02tMXHZletMs9jF6kGynan7xJqRqvWxkGS1ClHIUdt2uK6A6pbqOf2BwcBIxAdljLRrZOyvmW9KTqduHMemYv6xQnpNGb8moWq5V5FKiATvd/LB46O1zwZejJErfj70LRE98Hv4= stealth@operator'
state: present

3
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/stop-firewalld.yml

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
- systemd:
name: firewalld.service
enabled: no

1
playbooks/rugcms-frontend-uitrol/roles/frontend_acc_prod/tasks/upgrade.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
- yum: name=* state=latest

BIN
playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/Lib_Utils-1.00-09.noarch.rpm

Binary file not shown.

BIN
playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/MegaCli-8.04.07-1.noarch.rpm

Binary file not shown.

227
playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/firewall.sh

@ -0,0 +1,227 @@ @@ -0,0 +1,227 @@
#!/bin/bash
# prevent SYNC-floods:
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
# initialize:
iptables -F
iptables -X
iptables -Z
# config default policy's:
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -N LOGDROP
iptables -A LOGDROP -j LOG
iptables -A LOGDROP -j DROP
# kernel tweaks:
/bin/echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
/bin/echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
/bin/echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
/bin/echo 1 > /proc/sys/net/ipv4/conf/all/log_martians
/bin/echo 0 > /proc/sys/net/ipv4/ip_forward
# allow loopback:
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# allow asds.id.rug.nl
iptables -A INPUT -i eth0 -s 129.125.2.50 -j ACCEPT
iptables -A OUTPUT -o eth0 -d 129.125.2.50 -j ACCEPT
# allow vlan933:
iptables -A INPUT -i bond0.933 -j ACCEPT
iptables -A OUTPUT -o bond0.933 -j ACCEPT
# allow vlan934:
iptables -A INPUT -i bond0.934 -j ACCEPT
iptables -A OUTPUT -o bond0.934 -j ACCEPT
#allow outbound to databases:
iptables -A INPUT -p tcp -s 129.125.36.182 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.182 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.183 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.183 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.184 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.184 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.185 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.185 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.186 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.186 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.187 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.187 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.188 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.188 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.141 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.141 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.142 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.142 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.143 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.143 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.144 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.144 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.148 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.148 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.149 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.149 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.150 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.150 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.50.147 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.50.147 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.71 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.71 -j ACCEPT
# allow munin-statieken-server:
iptables -A INPUT -p tcp -s 129.125.50.91 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.50.91 -j ACCEPT
# allow agenda:
iptables -A INPUT -p tcp -s 129.125.2.116 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.2.116 -j ACCEPT
# allow imap.google.com:
iptables -A INPUT -p tcp -s 74.125.136/24 -j ACCEPT
iptables -A OUTPUT -p tcp -d 74.125.136/24 -j ACCEPT
# allow imap.rug.nl:
iptables -A INPUT -p tcp -s 129.125.2.81/32 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.2.81/32 -j ACCEPT
# allow more google:
iptables -A INPUT -p tcp -s 173.194.65.0/24 -j ACCEPT
iptables -A OUTPUT -p tcp -d 173.194.65.0/24 -j ACCEPT
# new tcp packets sync packets:
iptables -A INPUT -i eth0 -p tcp ! --syn -m state --state NEW -j DROP
# refuse loopback pacts incoming eth0:
iptables -A INPUT -i eth0 -d 127.0.0.0/8 -j DROP
# allow dns outbound to/from DNS server:
iptables -A INPUT -i eth0 -p udp --sport 53 -j ACCEPT
iptables -A OUTPUT -o eth0 -p udp --dport 53 -j ACCEPT
# allow www outbound to 80:
iptables -A INPUT -i eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow www outbound to 443:
iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow smtp outbound:
iptables -A INPUT -i eth0 -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow ssh from BWP:
iptables -A INPUT -i eth0 -p tcp -s 129.125.249.0/24 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -d 129.125.249.0/24 -m state --state ESTABLISHED -j ACCEPT
# log/drop the rest:
iptables -A INPUT -i eth0 -s 129.125.0.0/16 -d 129.125.36.121/32 -j LOGDROP
#zabbix monitorings
iptables -A INPUT -i eth0 -s 129.125.50.238 -j ACCEPT
iptables -A OUTPUT -o eth0 -d 129.125.50.238 -j ACCEPT
# allow 9080 inbound:
iptables -A INPUT -i eth0 -p tcp --dport 9080 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 9080 -j ACCEPT
# allow 2222 inbound:
iptables -A INPUT -i eth0 -p tcp -s 129.125.249.0/24 --dport 2222 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -d 129.125.249.0/24 --sport 2222 -j ACCEPT
# inbound gadgets:
iptables -A INPUT -i eth0 -p tcp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
# allow from operator:
iptables -A INPUT -i eth0 -s 129.125.50.41/32 -j ACCEPT
iptables -A OUTPUT -o eth0 -d 129.125.50.41/32 -j ACCEPT
# allow from/to ldap:
iptables -A INPUT -i eth0 -s 129.125.68.50/32 -j ACCEPT
iptables -A OUTPUT -o eth0 -d 129.125.68.50/32 -j ACCEPT
# ldaps outbound:
iptables -A INPUT -i eth0 -p tcp --sport 636 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 636 -m state --state NEW,ESTABLISHED -j ACCEPT
# allow nfs:
iptables -A INPUT -i eth0 -s 129.125.50.171/32 -j ACCEPT
iptables -A OUTPUT -o eth0 -d 129.125.50.171/32 -j ACCEPT
# allow ntp
iptables -A INPUT -i eth0 -p tcp --sport 123 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 123 -j ACCEPT
iptables -A INPUT -i eth0 -p udp --sport 123 -j ACCEPT
iptables -A OUTPUT -o eth0 -p udp --dport 123 -j ACCEPT
# allow charanga:
iptables -A INPUT -i eth0 -p tcp -s 129.125.60.94/32 --dport 22 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -d 129.125.60.94/32 --sport 22 -j ACCEPT
# charanga 129.125.60.94 port 2222:
iptables -A INPUT -i eth0 -p tcp -s 129.125.60.94/32 --dport 2222 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -d 129.125.60.94/32 --sport 2222 -j ACCEPT
# allow imaps:
iptables -A INPUT -p tcp --sport 993 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 993 -j ACCEPT
# Flush & default
ip6tables -F INPUT
ip6tables -F OUTPUT
ip6tables -F FORWARD
# setup log-chain:
ip6tables -N LOGREJECT
ip6tables -A LOGREJECT -j LOG
ip6tables -A LOGREJECT -j REJECT
# Set the default policy to drop
ip6tables -P INPUT DROP
ip6tables -P OUTPUT DROP
ip6tables -P FORWARD DROP
# rules:
ip6tables -A INPUT -i lo -j ACCEPT
ip6tables -A INPUT -j REJECT
ip6tables -A OUTPUT -j REJECT
# allow ganglia-statieken-server:
iptables -A INPUT -p tcp -s 129.125.60.89 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.60.89 -j ACCEPT
iptables -A INPUT -p tcp -s 129.125.36.191 -j ACCEPT
iptables -A OUTPUT -p tcp -d 129.125.36.191 -j ACCEPT
# open up port 9100 prometues:
iptables -A INPUT -i eth0 -p tcp -s 129.125.2.233/32 --dport 9100 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -d 129.125.2.233/32 --sport 9100 -j ACCEPT
# allow icmp:
iptables -A INPUT -p icmp -j ACCEPT
iptables -A OUTPUT -p icmp -j ACCEPT

209
playbooks/rugcms-frontend-uitrol/roles/frontend_test/files/megaclisas-status

@ -0,0 +1,209 @@ @@ -0,0 +1,209 @@
#!/usr/bin/python
import os
import re
import sys
binarypath = "/usr/sbin/megacli"
if len(sys.argv) > 2:
print 'Usage: megaclisas-status [--nagios]'
sys.exit(1)
nagiosmode=False
nagiosoutput=''
nagiosgoodarray=0
nagiosbadarray=0
nagiosgooddisk=0
nagiosbaddisk=0
# Check command line arguments to enable nagios or not
if len(sys.argv) > 1:
if sys.argv[1] == '--nagios':
nagiosmode=True
else:
print 'Usage: megaclisas-status [-nagios]'
sys.exit(1)
# Check binary exists (and +x), if not print an error message
# or return UNKNOWN nagios error code
if os.path.exists(binarypath) and os.access(binarypath, os.X_OK):
pass
else:
if nagiosmode:
print 'UNKNOWN - Cannot find '+binarypath
else:
print 'Cannot find '+binarypath+'. Please install it.'
sys.exit(3)
# Get command output
def getOutput(cmd):
output = os.popen(cmd)
lines = []
for line in output:
if not re.match(r'^$',line.strip()):
lines.append(line.strip())
return lines
def returnControllerNumber(output):
for line in output:
if re.match(r'^Controller Count.*$',line.strip()):
return int(line.split(':')[1].strip().strip('.'))
def returnControllerModel(output):
for line in output:
if re.match(r'^Product Name.*$',line.strip()):
return line.split(':')[1].strip()
def returnArrayNumber(output):
i = 0
for line in output:
if re.match(r'^Number of Virtual (Disk|Drive).*$',line.strip()):
i = line.strip().split(':')[1].strip()
return i
def returnArrayInfo(output,controllerid,arrayid):
id = 'c'+str(controllerid)+'u'+str(arrayid)
operationlinennumber = False
linenumber = 0
for line in output:
if re.match(r'Number Of Drives\s*((per span))?:.*[0-9]+$',line.strip()):
ldpdcount = line.split(':')[1].strip()
if re.match(r'Span Depth *:.*[0-9]+$',line.strip()):
spandepth = line.split(':')[1].strip()
if re.match(r'^RAID Level\s*:.*$',line.strip()):
raidlevel = line.strip().split(':')[1].split(',')[0].split('-')[1].strip()
type = 'RAID' + raidlevel
if re.match(r'^Size\s*:.*$',line.strip()):
# Size reported in MB
if re.match(r'^.*MB$',line.strip().split(':')[1]):
size = line.strip().split(':')[1].strip('MB').strip()
size = str(int(round((float(size) / 1000))))+'G'
# Size reported in TB
elif re.match(r'^.*TB$',line.strip().split(':')[1]):
size = line.strip().split(':')[1].strip('TB').strip()
size = str(int(round((float(size) * 1000))))+'G'
# Size reported in GB (default)
else:
size = line.strip().split(':')[1].strip('GB').strip()
size = str(int(round((float(size)))))+'G'
if re.match(r'^State\s*:.*$',line.strip()):
state = line.strip().split(':')[1].strip()
if re.match(r'^Ongoing Progresses\s*:.*$',line.strip()):
operationlinennumber = linenumber
linenumber += 1
if operationlinennumber:
inprogress = output[operationlinennumber+1]
else:
inprogress = 'None'
if ldpdcount and (int(spandepth) > 1):
ldpdcount = int(ldpdcount) * int(spandepth)
if int(raidlevel) < 10:
type = type + "0"
return [id,type,size,state,inprogress]
def returnDiskInfo(output,controllerid):
arrayid = False
diskid = False
table = []
state = 'undef'
model = 'undef'
for line in output:
if re.match(r'^Virtual (Disk|Drive): [0-9]+.*$',line.strip()):
arrayid = line.split('(')[0].split(':')[1].strip()
if re.match(r'Firmware state: .*$',line.strip()):
state = line.split(':')[1].strip()
if re.match(r'Inquiry Data: .*$',line.strip()):
model = line.split(':')[1].strip()
model = re.sub(' +', ' ', model)
if re.match(r'PD: [0-9]+ Information.*$',line.strip()):
diskid = line.split()[1].strip()
if arrayid != False and state != 'undef' and model != 'undef' and diskid != False:
table.append([str(arrayid), str(diskid), state, model])
state = 'undef'
model = 'undef'
return table
cmd = binarypath+' -adpCount -NoLog'
output = getOutput(cmd)
controllernumber = returnControllerNumber(output)
bad = False
# List available controller
if not nagiosmode:
print '-- Controller informations --'
print '-- ID | Model'
controllerid = 0
while controllerid < controllernumber:
cmd = binarypath+' -AdpAllInfo -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
controllermodel = returnControllerModel(output)
print 'c'+str(controllerid)+' | '+controllermodel
controllerid += 1
print ''
controllerid = 0
if not nagiosmode:
print '-- Arrays informations --'
print '-- ID | Type | Size | Status | InProgress'
while controllerid < controllernumber:
arrayid = 0
cmd = binarypath+' -LdGetNum -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
arraynumber = returnArrayNumber(output)
while arrayid < int(arraynumber):
cmd = binarypath+' -LDInfo -l'+str(arrayid)+' -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd)
arrayinfo = returnArrayInfo(output,controllerid,arrayid)
if not nagiosmode:
print arrayinfo[0]+' | '+arrayinfo[1]+' | '+arrayinfo[2]+' | '+arrayinfo[3]+' | '+arrayinfo[4]