...
 
Commits (2)
......@@ -56,6 +56,7 @@ requst by adding the software name to the list of `extra_software` in the
* elegant.yml: elegant (no Pelegant, yet)
* inovesa.yml: [Inovesa](https://github.com/Inovesa/Inovesa)
* undulator_control.yml: Install the software stack that is necessary to develop the control system for the JENA TGU experiment
* lab.yml: Lab infrastructure (DHCPd)
^1: (also put your FQDN to the \[common\] section in the hosts file as it depends hereon)
......
ansible_user: gethmann
ansible_user: root
user_account: bernhard
ip_suffix: 93
loc: -10.
loc: -119
os: ubuntu
computer_name: Taubenus
......@@ -100,7 +100,7 @@ las101.las.kit.edu
las126.las.kit.edu
[lab]
# las93.las.kit.edu
las93.las.kit.edu
[rpmbuild]
las113.las.kit.edu
......
- hosts: lab
roles:
- lab
......@@ -8,6 +8,7 @@
- import_tasks: sysupdate.yml
- import_tasks: ntp.yml
- import_tasks: yumrepos.yml
when: (ansible_distribution == "Fedora" or ansible_distribution == "CentOS")
tags: lasrepo
- import_tasks: software.yml
- import_tasks: smartd.yml
......
......@@ -19,3 +19,15 @@
- enable smartd
- restart smartd
when: (ansible_distribution == "Fedora" or ansible_distribution == "CentOS")
- name: configure smartd on Ubuntu
become: yes
lineinfile:
line: "DEVICESCAN -H -m {{ admin_mail }} -M exec /usr/libexec/smartmontools/smartdnotify -n standby,10,q -s (S/../.././02|L/../../6/03) -W 4,35,40"
regexp: ^DEVICESCAN .*$
backup: yes
path: /etc/smartd.conf
notify:
- enable smartd
- restart smartd
when: (ansible_distribution == "Ubuntu")
# dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
# option definitions common to all supported networks...
option domain-name "maglab";
# option domain-name-servers 129.13.64.5, 129.13.96.2;
default-lease-time 600;
max-lease-time 7200;
# Use this to enble / disable dynamic dns updates globally.
ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.1 192.168.0.100;
option routers 192.168.0.10;
option broadcast-address 192.168.0.255;
option domain-name "maglab";
# option domain-name-servers 129.13.64.5, 129.13.96.2;
default-lease-time 1800;
max-lease-time 7200;
deny unknown-clients;
}
include "/etc/dhcp/host-list-maglab";
$ANSIBLE_VAULT;1.1;AES256
37396239396130633430336539656561393639313333383133396365333731373533343535383132
6539323936383965313837383133643037323065393066650a386162663564653537326630306564
31653730653937303532616233313762613438353834383465636432636236643534316135313530
3136656465373339310a633337326263343737346132633031376536343534653263326264393138
35396461623933316230346163353634656237393134396462633362366435336665376464316232
62386333343837333933366362656434663034383065613739373361353765363964646531633831
37363034636438326535343363653938633331313466666237613835366131376430313733353862
37363766643331653765363533306432373838386434393730303338323634353965363765663865
62313139623530323331643730386265383031366635383662366666646635633464393961643666
64333263343930313032393936666536353933353963353234376165633964653663303466663862
34653333316462316134316465636230393536663030393465373538356661323933373234643333
65356262653139653835623536323936323531336566323037623065333237346130316638653166
63646533636531626262313036373437646537323365653430623766326130626538323337376437
31393938343165303336336236366431636431646633666462373161626331636362653136643862
35616662666336373431313965353861393630306635346136666362383532653939303566643561
66326230373466326533663636613436343130656238613236646361373130306137373563333362
64326364343330663262393966366638636562346431613663326636333036356235663739353662
34326564383438663039646163656435316631303134356566396535353934303764393665653562
61386234383361323763643431613263323561656538663534393830626538343230303831323961
39643135386338353665363366303837346635323962326161393434363438626562623265646163
30616161333865373731623330313731613931393738326364353932666337643533613538366166
64356536613963333866643131643332663635333633393265383436383331383833336162303335
64656532666431396539613265303938343334633234313863313466646638636232623339653839
66346439663763643465353038653130633633613733366331323036353939326462353636366236
64343432356163343462643931666462646435626461393232353762616633366637363861356338
38393939306633373961353930383263373135313834303433616264306538636337383834623931
35313766613434333639626434373837356335316133326664333765356530663364393165343665
35376634626366396233636265623237666432666461323837663666616435663135393038653536
37663237386162333162333232316464313736376461353330356237656537303035306439323936
36666632373163653866613933323061353762333530336465353437613261623238336365366335
36303132626238623939666362613837373061386663633633636266623835653061333731346564
36623765623333396230316331663537343664346436346461383064653732653766306334353432
37303562623166363633393762323930613266623232386135326234373234376662333636613934
63306534343764333538353031383639333165313334323839363831373133393135626636646134
63346431626431393937353231343763643132663433343137626630323765363262633331333933
33363864613537636434343536323865396661383230316662656137316137653966653865616131
31333831333462393065336139386638623861333332616639373238373762326438393566303439
39666230313035373533356533376662386638633465353936366363316239356166646537656638
63346439633431343264643432326432376239663436653936626337633365616336613237666563
65376666633061306562343739353731653237343963383937386661323562656537636166313036
61383937666536306130626562366232626330363633616539663330636538353736666636633835
64383033623334326332346561666531653838356263383035646365653132613930653032303734
34663963393730376536633131636265643336323764643762336536303361656133383038373765
39663834646562386137326265303433633232363661656661616338643364353963376362646431
38303037363738636331323566663836326332363664363565613333643435313230613830356330
37303564653930363066333035633461613462386538356361616132363730383438333063393464
37386562343262346533323630623139386437616236303836356233366565306633326132356132
66393861393431313531376538376163303232333331636634616436303632626239323166376361
65336439303036313834653632343635373966633363386534333936356161326535363564333931
33333562383835653430356231626366333234623238653033383064623431336665663835383738
32633965313332613535626431326161623237376564373133346630646633396535346365623662
32366264653435623932363461636630656332303730613762316437656633396364383438656162
37623931643934323563656133613737336665613362323733653564333730643835343935306435
34363132306266323430643234616466383037313132366639636636656437623538393839336562
65393931376366366364306366373833373439363437646235346531656639393234366339636235
64633636636637343034373935323763303464306233333631366261353465353334613539393333
30383063653863393130336232646563383861333466656661323130386537336638613736613931
63376335363933643132303831626231326662316335383762613433613562623361373336643564
31643137303430343734636165386535303464666437643531653762626131643733623965316462
64313634336139623635656133636336363561336639663939623335643038316661316139613066
65636466303637623234373538663166636335376537346537343038366235616537366330613066
61353839323138376565313366376637363732643334336534326439303732633734653337306534
30326632613432396363333431616331623765333264313833373133346137366233346263623663
64616665663464366361636339346332616265353632653639383766363734636533363831376637
38666239373761633738356436316134376265633361386337613065353234353934336164666636
65393965386434383735326364376132613362623338646262623164663632313863396238376632
38613631636330356166646231393230623531323338356135633831363034656638323632353637
32393936653134663566316639343130323235653136663862313765373561383834366132643437
31396564376563633530626335373366323038376265616165363839626363323561326232336334
64313531383361383138646233313031333234633561636132313332376266323631326334363630
31376666303263326163333262323362663031643032663963313632306239646335623438336561
66653832353133346235633761663666323562303030656434396432316639613739316234633862
64633131373430353931653638343066363631636162646666396535656138343337656531353061
61616564396235346566326338366138613438316465336538613739383165383366363465313261
62333366353465313439313866336366313166313463303363356337393737333337343163316235
62313534343933656133623632636332396230356438356238343837663436336431646330643139
65316165356433613033353366643234376464646232633833356630303533633166376263613436
62323166336438353764663639356662633734376331386130333937356137356532356363613638
31386161613037313361623438333539326563643331396230313933616432333365333930643230
30646639666262613366373062343533333461623466653337383432373661333666373931306262
61393361376433356432333431333232303035343531653234383736383636306636346136623066
38656464323936663465343735373831323038333039653865626537363165353466343439373938
61613563343137633262383332373533306533356533356331333338383034313035623039656138
62653133333862313565313138353331336663393531376464353361663362316563623635643564
63353538336132653538616238393537646532313739613833323336313132626562316634376537
37373133353031386663616665653339646139643265316161646435313465396562636438353130
34396165656362633236343332373662343366613030333538366438346537653265366537336237
61333335393237313737313637373534356136363836653030643334663966333362303565373866
31393030666135303435363235336334303665393135393339646333613530393363396432623936
37373763353135653663363632373364383036663435663862353730326138303838303263396266
333661316265656138623563653931653966
---
- name: enable dhcpd
service:
name: "{{ service_name }}"
enabled: yes
- name: restart dhcpd
service:
name: "{{ service_name }}"
state: restarted
- name: start dhcpd
service:
name: "{{ service_name }}"
state: started
---
- name: Load OS dependent variables
include_vars: '{{ item }}'
with_first_found:
- files:
- 'vars/{{ ansible_os_family }}.yml'
skip: true
tags: dhcpd
- name: dhcpd installed
become: true
apt:
name: "{{ pkg_name }}"
state: present
notify:
- start dhcpd
- enable dhcpd
- name: copy mac addresses and config
become: true
copy:
src: "{{ item }}"
dest: "/etc/dhcp/{{ item }}"
backup: yes
owner: dhcpd
group: dhcpd
mode: 0644
decrypt: yes
# https://superuser.com/questions/1286948/ansible-template-validation-fails-on-isc-dhcp-server
# validate: "{{ bin_path }} -t -cf %s"
notify: restart dhcpd
with_items:
- "host-list-maglab"
- dhcpd.conf
---
service_name: isc-dhcp-server
pkg_name: isc-dhcp-server
bin_path: /usr/sbin/dhcpd
---
service_name: dhcpd
pkg_name: dhcpd
bin_path: /sbin/dhcpd
......@@ -7,6 +7,17 @@
with_items:
- ssmtp
- mailx
when: (ansible_distribution == "Fedora" or ansible_distribution == "CentOS")
- name: install ssmtp and mailx
become: yes
package:
name: "{{ item }}"
state: present
with_items:
- ssmtp
- bsd-mailx
when: ansible_distribution == "Ubuntu"
- name: configure ssmtp user
become: yes
......
......@@ -33,3 +33,5 @@
tags: ripgrep
- import_playbook: epics.yml
tags: epics
- import_playbook: lab.yml
tags: lab