Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.rst 47KB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979
  1. ============
  2. Linux Fomula
  3. ============
  4. Linux Operating Systems.
  5. * Ubuntu
  6. * CentOS
  7. * RedHat
  8. * Fedora
  9. * Arch
  10. Sample Pillars
  11. ==============
  12. Linux System
  13. ------------
  14. Basic Linux box
  15. .. code-block:: yaml
  16. linux:
  17. system:
  18. enabled: true
  19. name: 'node1'
  20. domain: 'domain.com'
  21. cluster: 'system'
  22. environment: prod
  23. timezone: 'Europe/Prague'
  24. utc: true
  25. Linux with system users, some with password set:
  26. .. WARNING::
  27. If no 'password' variable has been passed - any predifined password
  28. will be removed.
  29. .. code-block:: yaml
  30. linux:
  31. system:
  32. ...
  33. user:
  34. jdoe:
  35. name: 'jdoe'
  36. enabled: true
  37. sudo: true
  38. shell: /bin/bash
  39. full_name: 'Jonh Doe'
  40. home: '/home/jdoe'
  41. home_dir_mode: 755
  42. email: 'jonh@doe.com'
  43. jsmith:
  44. name: 'jsmith'
  45. enabled: true
  46. full_name: 'With clear password'
  47. home: '/home/jsmith'
  48. hash_password: true
  49. password: "userpassword"
  50. mark:
  51. name: 'mark'
  52. enabled: true
  53. full_name: "unchange password'
  54. home: '/home/mark'
  55. password: false
  56. elizabeth:
  57. name: 'elizabeth'
  58. enabled: true
  59. full_name: 'With hased password'
  60. home: '/home/elizabeth'
  61. password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10"
  62. Configure sudo for users and groups under ``/etc/sudoers.d/``.
  63. This ways ``linux.system.sudo`` pillar map to actual sudo attributes:
  64. .. code-block:: jinja
  65. # simplified template:
  66. Cmds_Alias {{ alias }}={{ commands }}
  67. {{ user }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
  68. %{{ group }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
  69. # when rendered:
  70. saltuser1 ALL=(ALL) NOPASSWD: ALL
  71. .. code-block:: yaml
  72. linux:
  73. system:
  74. sudo:
  75. enabled: true
  76. aliases:
  77. host:
  78. LOCAL:
  79. - localhost
  80. PRODUCTION:
  81. - db1
  82. - db2
  83. runas:
  84. DBA:
  85. - postgres
  86. - mysql
  87. SALT:
  88. - root
  89. command:
  90. # Note: This is not 100% safe when ALL keyword is used, user still may modify configs and hide his actions.
  91. # Best practice is to specify full list of commands user is allowed to run.
  92. SUPPORT_RESTRICTED:
  93. - /bin/vi /etc/sudoers*
  94. - /bin/vim /etc/sudoers*
  95. - /bin/nano /etc/sudoers*
  96. - /bin/emacs /etc/sudoers*
  97. - /bin/su - root
  98. - /bin/su -
  99. - /bin/su
  100. - /usr/sbin/visudo
  101. SUPPORT_SHELLS:
  102. - /bin/sh
  103. - /bin/ksh
  104. - /bin/bash
  105. - /bin/rbash
  106. - /bin/dash
  107. - /bin/zsh
  108. - /bin/csh
  109. - /bin/fish
  110. - /bin/tcsh
  111. - /usr/bin/login
  112. - /usr/bin/su
  113. - /usr/su
  114. ALL_SALT_SAFE:
  115. - /usr/bin/salt state*
  116. - /usr/bin/salt service*
  117. - /usr/bin/salt pillar*
  118. - /usr/bin/salt grains*
  119. - /usr/bin/salt saltutil*
  120. - /usr/bin/salt-call state*
  121. - /usr/bin/salt-call service*
  122. - /usr/bin/salt-call pillar*
  123. - /usr/bin/salt-call grains*
  124. - /usr/bin/salt-call saltutil*
  125. SALT_TRUSTED:
  126. - /usr/bin/salt*
  127. users:
  128. # saltuser1 with default values: saltuser1 ALL=(ALL) NOPASSWD: ALL
  129. saltuser1: {}
  130. saltuser2:
  131. hosts:
  132. - LOCAL
  133. # User Alias DBA
  134. DBA:
  135. hosts:
  136. - ALL
  137. commands:
  138. - ALL_SALT_SAFE
  139. groups:
  140. db-ops:
  141. hosts:
  142. - ALL
  143. - '!PRODUCTION'
  144. runas:
  145. - DBA
  146. commands:
  147. - /bin/cat *
  148. - /bin/less *
  149. - /bin/ls *
  150. salt-ops:
  151. hosts:
  152. - 'ALL'
  153. runas:
  154. - SALT
  155. commands:
  156. - SUPPORT_SHELLS
  157. salt-ops-2nd:
  158. name: salt-ops
  159. nopasswd: false
  160. setenv: true # Enable sudo -E option
  161. runas:
  162. - DBA
  163. commands:
  164. - ALL
  165. - '!SUPPORT_SHELLS'
  166. - '!SUPPORT_RESTRICTED'
  167. Linux with package, latest version
  168. .. code-block:: yaml
  169. linux:
  170. system:
  171. ...
  172. package:
  173. package-name:
  174. version: latest
  175. Linux with package from certail repo, version with no upgrades
  176. .. code-block:: yaml
  177. linux:
  178. system:
  179. ...
  180. package:
  181. package-name:
  182. version: 2132.323
  183. repo: 'custom-repo'
  184. hold: true
  185. Linux with package from certail repo, version with no GPG verification
  186. .. code-block:: yaml
  187. linux:
  188. system:
  189. ...
  190. package:
  191. package-name:
  192. version: 2132.323
  193. repo: 'custom-repo'
  194. verify: false
  195. Linux with autoupdates (automatically install security package updates)
  196. .. code-block:: yaml
  197. linux:
  198. system:
  199. ...
  200. autoupdates:
  201. enabled: true
  202. mail: root@localhost
  203. mail_only_on_error: true
  204. remove_unused_dependencies: false
  205. automatic_reboot: true
  206. automatic_reboot_time: "02:00"
  207. Linux with cron jobs
  208. By default it will use name as an identifier, unless identifier key is
  209. explicitly set or False (then it will use Salt's default behavior which is
  210. identifier same as command resulting in not being able to change it)
  211. .. code-block:: yaml
  212. linux:
  213. system:
  214. ...
  215. job:
  216. cmd1:
  217. command: '/cmd/to/run'
  218. identifier: cmd1
  219. enabled: true
  220. user: 'root'
  221. hour: 2
  222. minute: 0
  223. Linux security limits (limit sensu user memory usage to max 1GB):
  224. .. code-block:: yaml
  225. linux:
  226. system:
  227. ...
  228. limit:
  229. sensu:
  230. enabled: true
  231. domain: sensu
  232. limits:
  233. - type: hard
  234. item: as
  235. value: 1000000
  236. Enable autologin on tty1 (may work only for Ubuntu 14.04):
  237. .. code-block:: yaml
  238. linux:
  239. system:
  240. console:
  241. tty1:
  242. autologin: root
  243. # Enable serial console
  244. ttyS0:
  245. autologin: root
  246. rate: 115200
  247. term: xterm
  248. To disable set autologin to `false`.
  249. Set ``policy-rc.d`` on Debian-based systems. Action can be any available
  250. command in ``while true`` loop and ``case`` context.
  251. Following will disallow dpkg to stop/start services for cassandra package automatically:
  252. .. code-block:: yaml
  253. linux:
  254. system:
  255. policyrcd:
  256. - package: cassandra
  257. action: exit 101
  258. - package: '*'
  259. action: switch
  260. Set system locales:
  261. .. code-block:: yaml
  262. linux:
  263. system:
  264. locale:
  265. en_US.UTF-8:
  266. default: true
  267. "cs_CZ.UTF-8 UTF-8":
  268. enabled: true
  269. Systemd settings:
  270. .. code-block:: yaml
  271. linux:
  272. system:
  273. ...
  274. systemd:
  275. system:
  276. Manager:
  277. DefaultLimitNOFILE: 307200
  278. DefaultLimitNPROC: 307200
  279. user:
  280. Manager:
  281. DefaultLimitCPU: 2
  282. DefaultLimitNPROC: 4
  283. Ensure presence of directory:
  284. .. code-block:: yaml
  285. linux:
  286. system:
  287. directory:
  288. /tmp/test:
  289. user: root
  290. group: root
  291. mode: 700
  292. makedirs: true
  293. Ensure presence of file by specifying it's source:
  294. .. code-block:: yaml
  295. linux:
  296. system:
  297. file:
  298. /tmp/test.txt:
  299. source: http://example.com/test.txt
  300. user: root #optional
  301. group: root #optional
  302. mode: 700 #optional
  303. dir_mode: 700 #optional
  304. encoding: utf-8 #optional
  305. hash: <<hash>> or <<URI to hash>> #optional
  306. makedirs: true #optional
  307. linux:
  308. system:
  309. file:
  310. test.txt:
  311. name: /tmp/test.txt
  312. source: http://example.com/test.txt
  313. Ensure presence of file by specifying it's contents:
  314. .. code-block:: yaml
  315. linux:
  316. system:
  317. file:
  318. /tmp/test.txt:
  319. contents: |
  320. line1
  321. line2
  322. linux:
  323. system:
  324. file:
  325. /tmp/test.txt:
  326. contents_pillar: linux:network:hostname
  327. linux:
  328. system:
  329. file:
  330. /tmp/test.txt:
  331. contents_grains: motd
  332. Ensure presence of file to be serialized through one of the serializer modules
  333. (see: https://docs.saltstack.com/en/latest/ref/serializers/all/index.html):
  334. .. code-block:: yaml
  335. linux:
  336. system:
  337. file:
  338. /tmp/test.json:
  339. serialize: json
  340. contents:
  341. foo: 1
  342. bar: 'bar'
  343. Kernel
  344. ~~~~~~
  345. Install always up to date LTS kernel and headers from Ubuntu trusty:
  346. .. code-block:: yaml
  347. linux:
  348. system:
  349. kernel:
  350. type: generic
  351. lts: trusty
  352. headers: true
  353. Load kernel modules and add them to `/etc/modules`:
  354. .. code-block:: yaml
  355. linux:
  356. system:
  357. kernel:
  358. modules:
  359. - nf_conntrack
  360. - tp_smapi
  361. - 8021q
  362. Configure or blacklist kernel modules with additional options to `/etc/modprobe.d` following example
  363. will add `/etc/modprobe.d/nf_conntrack.conf` file with line `options nf_conntrack hashsize=262144`:
  364. .. code-block:: yaml
  365. linux:
  366. system:
  367. kernel:
  368. module:
  369. nf_conntrack:
  370. option:
  371. hashsize: 262144
  372. Install specific kernel version and ensure all other kernel packages are
  373. not present. Also install extra modules and headers for this kernel:
  374. .. code-block:: yaml
  375. linux:
  376. system:
  377. kernel:
  378. type: generic
  379. extra: true
  380. headers: true
  381. version: 4.2.0-22
  382. Systcl kernel parameters
  383. .. code-block:: yaml
  384. linux:
  385. system:
  386. kernel:
  387. sysctl:
  388. net.ipv4.tcp_keepalive_intvl: 3
  389. net.ipv4.tcp_keepalive_time: 30
  390. net.ipv4.tcp_keepalive_probes: 8
  391. Configure kernel boot options:
  392. .. code-block:: yaml
  393. linux:
  394. system:
  395. kernel:
  396. boot_options:
  397. - elevator=deadline
  398. - spectre_v2=off
  399. - nopti
  400. CPU
  401. ~~~
  402. Enable cpufreq governor for every cpu:
  403. .. code-block:: yaml
  404. linux:
  405. system:
  406. cpu:
  407. governor: performance
  408. CGROUPS
  409. ~~~~~~~
  410. Setup linux cgroups:
  411. .. code-block:: yaml
  412. linux:
  413. system:
  414. cgroup:
  415. enabled: true
  416. group:
  417. ceph_group_1:
  418. controller:
  419. cpu:
  420. shares:
  421. value: 250
  422. cpuacct:
  423. usage:
  424. value: 0
  425. cpuset:
  426. cpus:
  427. value: 1,2,3
  428. memory:
  429. limit_in_bytes:
  430. value: 2G
  431. memsw.limit_in_bytes:
  432. value: 3G
  433. mapping:
  434. subjects:
  435. - '@ceph'
  436. generic_group_1:
  437. controller:
  438. cpu:
  439. shares:
  440. value: 250
  441. cpuacct:
  442. usage:
  443. value: 0
  444. mapping:
  445. subjects:
  446. - '*:firefox'
  447. - 'student:cp'
  448. Shared Libraries
  449. ~~~~~~~~~~~~~~~~
  450. Set additional shared library to Linux system library path
  451. .. code-block:: yaml
  452. linux:
  453. system:
  454. ld:
  455. library:
  456. java:
  457. - /usr/lib/jvm/jre-openjdk/lib/amd64/server
  458. - /opt/java/jre/lib/amd64/server
  459. Certificates
  460. ~~~~~~~~~~~~
  461. Add certificate authority into system trusted CA bundle
  462. .. code-block:: yaml
  463. linux:
  464. system:
  465. ca_certificates:
  466. mycert: |
  467. -----BEGIN CERTIFICATE-----
  468. MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
  469. A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
  470. cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
  471. MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
  472. BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
  473. YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
  474. ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
  475. BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
  476. I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
  477. CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
  478. lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
  479. AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
  480. -----END CERTIFICATE-----
  481. Sysfs
  482. ~~~~~
  483. Install sysfsutils and set sysfs attributes:
  484. .. code-block:: yaml
  485. linux:
  486. system:
  487. sysfs:
  488. scheduler:
  489. block/sda/queue/scheduler: deadline
  490. power:
  491. mode:
  492. power/state: 0660
  493. owner:
  494. power/state: "root:power"
  495. devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
  496. Optional: You can also use list that will ensure order of items.
  497. .. code-block:: yaml
  498. linux:
  499. system:
  500. sysfs:
  501. scheduler:
  502. block/sda/queue/scheduler: deadline
  503. power:
  504. - mode:
  505. power/state: 0660
  506. - owner:
  507. power/state: "root:power"
  508. - devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
  509. Huge Pages
  510. ~~~~~~~~~~~~
  511. Huge Pages give a performance boost to applications that intensively deal
  512. with memory allocation/deallocation by decreasing memory fragmentation.
  513. .. code-block:: yaml
  514. linux:
  515. system:
  516. kernel:
  517. hugepages:
  518. small:
  519. size: 2M
  520. count: 107520
  521. mount_point: /mnt/hugepages_2MB
  522. mount: false/true # default is true (mount immediately) / false (just save in the fstab)
  523. large:
  524. default: true # default automatically mounted
  525. size: 1G
  526. count: 210
  527. mount_point: /mnt/hugepages_1GB
  528. Note: not recommended to use both pagesizes in concurrently.
  529. Intel SR-IOV
  530. ~~~~~~~~~~~~
  531. PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV) specification defines a standardized mechanism to virtualize PCIe devices. The mechanism can virtualize a single PCIe Ethernet controller to appear as multiple PCIe devices.
  532. .. code-block:: yaml
  533. linux:
  534. system:
  535. kernel:
  536. sriov: True
  537. unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
  538. rc:
  539. local: |
  540. #!/bin/sh -e
  541. # Enable 7 VF on eth1
  542. echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
  543. exit 0
  544. Isolate CPU options
  545. ~~~~~~~~~~~~~~~~~~~
  546. Remove the specified CPUs, as defined by the cpu_number values, from the general kernel
  547. SMP balancing and scheduler algroithms. The only way to move a process onto or off an
  548. "isolated" CPU is via the CPU affinity syscalls. cpu_number begins at 0, so the
  549. maximum value is 1 less than the number of CPUs on the system.
  550. .. code-block:: yaml
  551. linux:
  552. system:
  553. kernel:
  554. isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
  555. Repositories
  556. ~~~~~~~~~~~~
  557. RedHat based Linux with additional OpenStack repo
  558. .. code-block:: yaml
  559. linux:
  560. system:
  561. ...
  562. repo:
  563. rdo-icehouse:
  564. enabled: true
  565. source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
  566. pgpcheck: 0
  567. Ensure system repository to use czech Debian mirror (``default: true``)
  568. Also pin it's packages with priority 900.
  569. .. code-block:: yaml
  570. linux:
  571. system:
  572. repo:
  573. debian:
  574. default: true
  575. source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
  576. # Import signing key from URL if needed
  577. key_url: "http://dummy.com/public.gpg"
  578. pin:
  579. - pin: 'origin "ftp.cz.debian.org"'
  580. priority: 900
  581. package: '*'
  582. Package manager proxy setup globally:
  583. .. code-block:: yaml
  584. linux:
  585. system:
  586. ...
  587. repo:
  588. apt-mk:
  589. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  590. ...
  591. proxy:
  592. pkg:
  593. enabled: true
  594. ftp: ftp://ftp-proxy-for-apt.host.local:2121
  595. ...
  596. # NOTE: Global defaults for any other componet that configure proxy on the system.
  597. # If your environment has just one simple proxy, set it on linux:system:proxy.
  598. #
  599. # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
  600. # as for https and http
  601. ftp: ftp://proxy.host.local:2121
  602. http: http://proxy.host.local:3142
  603. https: https://proxy.host.local:3143
  604. Package manager proxy setup per repository:
  605. .. code-block:: yaml
  606. linux:
  607. system:
  608. ...
  609. repo:
  610. debian:
  611. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  612. ...
  613. apt-mk:
  614. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  615. # per repository proxy
  616. proxy:
  617. enabled: true
  618. http: http://maas-01:8080
  619. https: http://maas-01:8080
  620. ...
  621. proxy:
  622. # package manager fallback defaults
  623. # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
  624. pkg:
  625. enabled: true
  626. ftp: ftp://proxy.host.local:2121
  627. #http: http://proxy.host.local:3142
  628. #https: https://proxy.host.local:3143
  629. ...
  630. # global system fallback system defaults
  631. ftp: ftp://proxy.host.local:2121
  632. http: http://proxy.host.local:3142
  633. https: https://proxy.host.local:3143
  634. Remove all repositories:
  635. .. code-block:: yaml
  636. linux:
  637. system:
  638. purge_repos: true
  639. Setup custom apt config options:
  640. .. code-block:: yaml
  641. linux:
  642. system:
  643. apt:
  644. config:
  645. compression-workaround:
  646. "Acquire::CompressionTypes::Order": "gz"
  647. docker-clean:
  648. "DPkg::Post-Invoke":
  649. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  650. "APT::Update::Post-Invoke":
  651. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  652. RC
  653. ~~
  654. rc.local example
  655. .. code-block:: yaml
  656. linux:
  657. system:
  658. rc:
  659. local: |
  660. #!/bin/sh -e
  661. #
  662. # rc.local
  663. #
  664. # This script is executed at the end of each multiuser runlevel.
  665. # Make sure that the script will "exit 0" on success or any other
  666. # value on error.
  667. #
  668. # In order to enable or disable this script just change the execution
  669. # bits.
  670. #
  671. # By default this script does nothing.
  672. exit 0
  673. Prompt
  674. ~~~~~~
  675. Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every
  676. user can have different prompt.
  677. .. code-block:: yaml
  678. linux:
  679. system:
  680. prompt:
  681. root: \\n\\[\\033[0;37m\\]\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\[\\e[0m\\]\\n\\[\\e[1;31m\\][\\u@\\h:\\w]\\[\\e[0m\\]
  682. default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
  683. On Debian systems to set prompt system-wide it's necessary to remove setting
  684. PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from
  685. ``/etc/skel/.bashrc``). This formula will do this automatically, but will not
  686. touch existing user's ``~/.bashrc`` files except root.
  687. Bash
  688. ~~~~
  689. Fix bash configuration to preserve history across sessions (like ZSH does by
  690. default).
  691. .. code-block:: yaml
  692. linux:
  693. system:
  694. bash:
  695. preserve_history: true
  696. Login banner message
  697. ~~~~~~~~~~~~~~~~~~~~
  698. /etc/issue is a text file which contains a message or system
  699. identification to be printed before the login prompt. It may contain
  700. various @char and \char sequences, if supported by the getty-type
  701. program employed on the system.
  702. Setting logon banner message is easy:
  703. .. code-block:: yaml
  704. liunx:
  705. system:
  706. banner:
  707. enabled: true
  708. contents: |
  709. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  710. You must have explicit, authorized permission to access or configure this
  711. device. Unauthorized attempts and actions to access or use this system may
  712. result in civil and/or criminal penalties.
  713. All activities performed on this system are logged and monitored.
  714. Message of the day
  715. ~~~~~~~~~~~~~~~~~~
  716. ``pam_motd`` from package ``libpam-modules`` is used for dynamic messages of the
  717. day. Setting custom motd will cleanup existing ones.
  718. Setting static motd will replace existing ``/etc/motd`` and remove scripts from
  719. ``/etc/update-motd.d``.
  720. Setting static motd:
  721. .. code-block:: yaml
  722. linux:
  723. system:
  724. motd: |
  725. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  726. You must have explicit, authorized permission to access or configure this
  727. device. Unauthorized attempts and actions to access or use this system may
  728. result in civil and/or criminal penalties.
  729. All activities performed on this system are logged and monitored.
  730. Setting dynamic motd:
  731. .. code-block:: yaml
  732. linux:
  733. system:
  734. motd:
  735. - release: |
  736. #!/bin/sh
  737. [ -r /etc/lsb-release ] && . /etc/lsb-release
  738. if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
  739. # Fall back to using the very slow lsb_release utility
  740. DISTRIB_DESCRIPTION=$(lsb_release -s -d)
  741. fi
  742. printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
  743. - warning: |
  744. #!/bin/sh
  745. printf "This is [company name] network.\n"
  746. printf "Unauthorized access strictly prohibited.\n"
  747. Services
  748. ~~~~~~~~
  749. Stop and disable linux service:
  750. .. code-block:: yaml
  751. linux:
  752. system:
  753. service:
  754. apt-daily.timer:
  755. status: dead
  756. Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.
  757. Linux with atop service:
  758. .. code-block:: yaml
  759. linux:
  760. system:
  761. atop:
  762. enabled: true
  763. interval: 20
  764. logpath: "/var/log/atop"
  765. outfile: "/var/log/atop/daily.log"
  766. Linux with mcelog service:
  767. .. code-block:: yaml
  768. linux:
  769. system:
  770. mcelog:
  771. enabled: true
  772. logging:
  773. syslog: true
  774. syslog_error: true
  775. RHEL / CentOS
  776. ^^^^^^^^^^^^^
  777. Unfortunately ``update-motd`` is currently not available for RHEL so there's
  778. no native support for dynamic motd.
  779. You can still set static one, only pillar structure differs:
  780. .. code-block:: yaml
  781. linux:
  782. system:
  783. motd: |
  784. This is [company name] network.
  785. Unauthorized access strictly prohibited.
  786. Haveged
  787. ~~~~~~~
  788. If you are running headless server and are low on entropy, it may be a good
  789. idea to setup Haveged.
  790. .. code-block:: yaml
  791. linux:
  792. system:
  793. haveged:
  794. enabled: true
  795. Linux network
  796. -------------
  797. Linux with network manager
  798. .. code-block:: yaml
  799. linux:
  800. network:
  801. enabled: true
  802. network_manager: true
  803. Linux with default static network interfaces, default gateway interface and DNS servers
  804. .. code-block:: yaml
  805. linux:
  806. network:
  807. enabled: true
  808. interface:
  809. eth0:
  810. enabled: true
  811. type: eth
  812. address: 192.168.0.102
  813. netmask: 255.255.255.0
  814. gateway: 192.168.0.1
  815. name_servers:
  816. - 8.8.8.8
  817. - 8.8.4.4
  818. mtu: 1500
  819. Linux with bonded interfaces and disabled NetworkManager
  820. .. code-block:: yaml
  821. linux:
  822. network:
  823. enabled: true
  824. interface:
  825. eth0:
  826. type: eth
  827. ...
  828. eth1:
  829. type: eth
  830. ...
  831. bond0:
  832. enabled: true
  833. type: bond
  834. address: 192.168.0.102
  835. netmask: 255.255.255.0
  836. mtu: 1500
  837. use_in:
  838. - interface: ${linux:interface:eth0}
  839. - interface: ${linux:interface:eth0}
  840. network_manager:
  841. disable: true
  842. Linux with vlan interface_params
  843. .. code-block:: yaml
  844. linux:
  845. network:
  846. enabled: true
  847. interface:
  848. vlan69:
  849. type: vlan
  850. use_interfaces:
  851. - interface: ${linux:interface:bond0}
  852. Linux with wireless interface parameters
  853. .. code-block:: yaml
  854. linux:
  855. network:
  856. enabled: true
  857. gateway: 10.0.0.1
  858. default_interface: eth0
  859. interface:
  860. wlan0:
  861. type: eth
  862. wireless:
  863. essid: example
  864. key: example_key
  865. security: wpa
  866. priority: 1
  867. Linux networks with routes defined
  868. .. code-block:: yaml
  869. linux:
  870. network:
  871. enabled: true
  872. gateway: 10.0.0.1
  873. default_interface: eth0
  874. interface:
  875. eth0:
  876. type: eth
  877. route:
  878. default:
  879. address: 192.168.0.123
  880. netmask: 255.255.255.0
  881. gateway: 192.168.0.1
  882. Native Linux Bridges
  883. .. code-block:: yaml
  884. linux:
  885. network:
  886. interface:
  887. eth1:
  888. enabled: true
  889. type: eth
  890. proto: manual
  891. up_cmds:
  892. - ip address add 0/0 dev $IFACE
  893. - ip link set $IFACE up
  894. down_cmds:
  895. - ip link set $IFACE down
  896. br-ex:
  897. enabled: true
  898. type: bridge
  899. address: ${linux:network:host:public_local:address}
  900. netmask: 255.255.255.0
  901. use_interfaces:
  902. - eth1
  903. OpenVswitch Bridges
  904. .. code-block:: yaml
  905. linux:
  906. network:
  907. bridge: openvswitch
  908. interface:
  909. eth1:
  910. enabled: true
  911. type: eth
  912. proto: manual
  913. up_cmds:
  914. - ip address add 0/0 dev $IFACE
  915. - ip link set $IFACE up
  916. down_cmds:
  917. - ip link set $IFACE down
  918. br-ex:
  919. enabled: true
  920. type: bridge
  921. address: ${linux:network:host:public_local:address}
  922. netmask: 255.255.255.0
  923. use_interfaces:
  924. - eth1
  925. br-prv:
  926. enabled: true
  927. type: ovs_bridge
  928. mtu: 65000
  929. br-ens7:
  930. enabled: true
  931. name: br-ens7
  932. type: ovs_bridge
  933. proto: manual
  934. mtu: 9000
  935. use_interfaces:
  936. - ens7
  937. patch-br-ens7-br-prv:
  938. enabled: true
  939. name: ens7-prv
  940. ovs_type: ovs_port
  941. type: ovs_port
  942. bridge: br-ens7
  943. port_type: patch
  944. peer: prv-ens7
  945. tag: 109 # [] to unset a tag
  946. mtu: 65000
  947. patch-br-prv-br-ens7:
  948. enabled: true
  949. name: prv-ens7
  950. bridge: br-prv
  951. ovs_type: ovs_port
  952. type: ovs_port
  953. port_type: patch
  954. peer: ens7-prv
  955. tag: 109
  956. mtu: 65000
  957. ens7:
  958. enabled: true
  959. name: ens7
  960. proto: manual
  961. ovs_port_type: OVSPort
  962. type: ovs_port
  963. ovs_bridge: br-ens7
  964. bridge: br-ens7
  965. Debian manual proto interfaces
  966. When you are changing interface proto from static in up state to manual, you
  967. may need to flush ip addresses. For example, if you want to use the interface
  968. and the ip on the bridge. This can be done by setting the ``ipflush_onchange``
  969. to true.
  970. .. code-block:: yaml
  971. linux:
  972. network:
  973. interface:
  974. eth1:
  975. enabled: true
  976. type: eth
  977. proto: manual
  978. mtu: 9100
  979. ipflush_onchange: true
  980. Debian static proto interfaces
  981. When you are changing interface proto from dhcp in up state to static, you
  982. may need to flush ip addresses and restart interface to assign ip address from a managed file.
  983. For example, if you want to use the interface and the ip on the bridge.
  984. This can be done by setting the ``ipflush_onchange`` with combination
  985. ``restart_on_ipflush`` param set to to true.
  986. .. code-block:: yaml
  987. linux:
  988. network:
  989. interface:
  990. eth1:
  991. enabled: true
  992. type: eth
  993. proto: static
  994. address: 10.1.0.22
  995. netmask: 255.255.255.0
  996. ipflush_onchange: true
  997. restart_on_ipflush: true
  998. Concatinating and removing interface files
  999. Debian based distributions have `/etc/network/interfaces.d/` directory, where
  1000. you can store configuration of network interfaces in separate files. You can
  1001. concatinate the files to the defined destination when needed, this operation
  1002. removes the file from the `/etc/network/interfaces.d/`. If you just need to
  1003. remove iface files, you can use the `remove_iface_files` key.
  1004. .. code-block:: yaml
  1005. linux:
  1006. network:
  1007. concat_iface_files:
  1008. - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
  1009. dst: '/etc/network/interfaces'
  1010. remove_iface_files:
  1011. - '/etc/network/interfaces.d/90-custom.cfg'
  1012. DHCP client configuration
  1013. None of the keys is mandatory, include only those you really need. For full list
  1014. of available options under send, supersede, prepend, append refer to dhcp-options(5)
  1015. .. code-block:: yaml
  1016. linux:
  1017. network:
  1018. dhclient:
  1019. enabled: true
  1020. backoff_cutoff: 15
  1021. initial_interval: 10
  1022. reboot: 10
  1023. retry: 60
  1024. select_timeout: 0
  1025. timeout: 120
  1026. send:
  1027. - option: host-name
  1028. declaration: "= gethostname()"
  1029. supersede:
  1030. - option: host-name
  1031. declaration: "spaceship"
  1032. - option: domain-name
  1033. declaration: "domain.home"
  1034. #- option: arp-cache-timeout
  1035. # declaration: 20
  1036. prepend:
  1037. - option: domain-name-servers
  1038. declaration:
  1039. - 8.8.8.8
  1040. - 8.8.4.4
  1041. - option: domain-search
  1042. declaration:
  1043. - example.com
  1044. - eng.example.com
  1045. #append:
  1046. #- option: domain-name-servers
  1047. # declaration: 127.0.0.1
  1048. # ip or subnet to reject dhcp offer from
  1049. reject:
  1050. - 192.33.137.209
  1051. - 10.0.2.0/24
  1052. request:
  1053. - subnet-mask
  1054. - broadcast-address
  1055. - time-offset
  1056. - routers
  1057. - domain-name
  1058. - domain-name-servers
  1059. - domain-search
  1060. - host-name
  1061. - dhcp6.name-servers
  1062. - dhcp6.domain-search
  1063. - dhcp6.fqdn
  1064. - dhcp6.sntp-servers
  1065. - netbios-name-servers
  1066. - netbios-scope
  1067. - interface-mtu
  1068. - rfc3442-classless-static-routes
  1069. - ntp-servers
  1070. require:
  1071. - subnet-mask
  1072. - domain-name-servers
  1073. # if per interface configuration required add below
  1074. interface:
  1075. ens2:
  1076. initial_interval: 11
  1077. reject:
  1078. - 192.33.137.210
  1079. ens3:
  1080. initial_interval: 12
  1081. reject:
  1082. - 192.33.137.211
  1083. Linux network systemd settings:
  1084. .. code-block:: yaml
  1085. linux:
  1086. network:
  1087. ...
  1088. systemd:
  1089. link:
  1090. 10-iface-dmz:
  1091. Match:
  1092. MACAddress: c8:5b:67:fa:1a:af
  1093. OriginalName: eth0
  1094. Link:
  1095. Name: dmz0
  1096. netdev:
  1097. 20-bridge-dmz:
  1098. match:
  1099. name: dmz0
  1100. network:
  1101. mescription: bridge
  1102. bridge: br-dmz0
  1103. network:
  1104. # works with lowercase, keys are by default capitalized
  1105. 40-dhcp:
  1106. match:
  1107. name: '*'
  1108. network:
  1109. DHCP: yes
  1110. Configure global environment variables
  1111. Use ``/etc/environment`` for static system wide variable assignment after
  1112. boot. Variable expansion is frequently not supported.
  1113. .. code-block:: yaml
  1114. linux:
  1115. system:
  1116. env:
  1117. BOB_VARIABLE: Alice
  1118. ...
  1119. BOB_PATH:
  1120. - /srv/alice/bin
  1121. - /srv/bob/bin
  1122. ...
  1123. ftp_proxy: none
  1124. http_proxy: http://global-http-proxy.host.local:8080
  1125. https_proxy: ${linux:system:proxy:https}
  1126. no_proxy:
  1127. - 192.168.0.80
  1128. - 192.168.1.80
  1129. - .domain.com
  1130. - .local
  1131. ...
  1132. # NOTE: global defaults proxy configuration.
  1133. proxy:
  1134. ftp: ftp://proxy.host.local:2121
  1135. http: http://proxy.host.local:3142
  1136. https: https://proxy.host.local:3143
  1137. noproxy:
  1138. - .domain.com
  1139. - .local
  1140. Configure profile.d scripts
  1141. The profile.d scripts are being sourced during .sh execution and support
  1142. variable expansion in opposite to /etc/environment global settings in
  1143. ``/etc/environment``.
  1144. .. code-block:: yaml
  1145. linux:
  1146. system:
  1147. profile:
  1148. locales: |
  1149. export LANG=C
  1150. export LC_ALL=C
  1151. ...
  1152. vi_flavors.sh: |
  1153. export PAGER=view
  1154. export EDITOR=vim
  1155. alias vi=vim
  1156. shell_locales.sh: |
  1157. export LANG=en_US
  1158. export LC_ALL=en_US.UTF-8
  1159. shell_proxies.sh: |
  1160. export FTP_PROXY=ftp://127.0.3.3:2121
  1161. export NO_PROXY='.local'
  1162. Linux with hosts
  1163. Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
  1164. that are not defined in model except defaults for both IPv4 and IPv6 localhost
  1165. and hostname + fqdn.
  1166. It's good to use this option if you want to ensure /etc/hosts is always in a
  1167. clean state however it's not enabled by default for safety.
  1168. .. code-block:: yaml
  1169. linux:
  1170. network:
  1171. purge_hosts: true
  1172. host:
  1173. # No need to define this one if purge_hosts is true
  1174. hostname:
  1175. address: 127.0.1.1
  1176. names:
  1177. - ${linux:network:fqdn}
  1178. - ${linux:network:hostname}
  1179. node1:
  1180. address: 192.168.10.200
  1181. names:
  1182. - node2.domain.com
  1183. - service2.domain.com
  1184. node2:
  1185. address: 192.168.10.201
  1186. names:
  1187. - node2.domain.com
  1188. - service2.domain.com
  1189. Linux with hosts collected from mine
  1190. In this case all dns records defined within infrastrucuture will be passed to
  1191. local hosts records or any DNS server. Only hosts with `grain` parameter to
  1192. true will be propagated to the mine.
  1193. .. code-block:: yaml
  1194. linux:
  1195. network:
  1196. purge_hosts: true
  1197. mine_dns_records: true
  1198. host:
  1199. node1:
  1200. address: 192.168.10.200
  1201. grain: true
  1202. names:
  1203. - node2.domain.com
  1204. - service2.domain.com
  1205. Setup resolv.conf, nameservers, domain and search domains
  1206. .. code-block:: yaml
  1207. linux:
  1208. network:
  1209. resolv:
  1210. dns:
  1211. - 8.8.4.4
  1212. - 8.8.8.8
  1213. domain: my.example.com
  1214. search:
  1215. - my.example.com
  1216. - example.com
  1217. options:
  1218. - ndots: 5
  1219. - timeout: 2
  1220. - attempts: 2
  1221. setting custom TX queue length for tap interfaces
  1222. .. code-block:: yaml
  1223. linux:
  1224. network:
  1225. tap_custom_txqueuelen: 10000
  1226. DPDK OVS interfaces
  1227. **DPDK OVS NIC**
  1228. .. code-block:: yaml
  1229. linux:
  1230. network:
  1231. bridge: openvswitch
  1232. dpdk:
  1233. enabled: true
  1234. driver: uio/vfio
  1235. openvswitch:
  1236. pmd_cpu_mask: "0x6"
  1237. dpdk_socket_mem: "1024,1024"
  1238. dpdk_lcore_mask: "0x400"
  1239. memory_channels: 2
  1240. interface:
  1241. dpkd0:
  1242. name: ${_param:dpdk_nic}
  1243. pci: 0000:06:00.0
  1244. driver: igb_uio/vfio-pci
  1245. enabled: true
  1246. type: dpdk_ovs_port
  1247. n_rxq: 2
  1248. pmd_rxq_affinity: "0:1,1:2"
  1249. bridge: br-prv
  1250. mtu: 9000
  1251. br-prv:
  1252. enabled: true
  1253. type: dpdk_ovs_bridge
  1254. **DPDK OVS Bond**
  1255. .. code-block:: yaml
  1256. linux:
  1257. network:
  1258. bridge: openvswitch
  1259. dpdk:
  1260. enabled: true
  1261. driver: uio/vfio
  1262. openvswitch:
  1263. pmd_cpu_mask: "0x6"
  1264. dpdk_socket_mem: "1024,1024"
  1265. dpdk_lcore_mask: "0x400"
  1266. memory_channels: 2
  1267. interface:
  1268. dpdk_second_nic:
  1269. name: ${_param:primary_second_nic}
  1270. pci: 0000:06:00.0
  1271. driver: igb_uio/vfio-pci
  1272. bond: dpdkbond0
  1273. enabled: true
  1274. type: dpdk_ovs_port
  1275. n_rxq: 2
  1276. pmd_rxq_affinity: "0:1,1:2"
  1277. mtu: 9000
  1278. dpdk_first_nic:
  1279. name: ${_param:primary_first_nic}
  1280. pci: 0000:05:00.0
  1281. driver: igb_uio/vfio-pci
  1282. bond: dpdkbond0
  1283. enabled: true
  1284. type: dpdk_ovs_port
  1285. n_rxq: 2
  1286. pmd_rxq_affinity: "0:1,1:2"
  1287. mtu: 9000
  1288. dpdkbond0:
  1289. enabled: true
  1290. bridge: br-prv
  1291. type: dpdk_ovs_bond
  1292. mode: active-backup
  1293. br-prv:
  1294. enabled: true
  1295. type: dpdk_ovs_bridge
  1296. **DPDK OVS LACP Bond with vlan tag**
  1297. .. code-block:: yaml
  1298. linux:
  1299. network:
  1300. bridge: openvswitch
  1301. dpdk:
  1302. enabled: true
  1303. driver: uio
  1304. openvswitch:
  1305. pmd_cpu_mask: "0x6"
  1306. dpdk_socket_mem: "1024,1024"
  1307. dpdk_lcore_mask: "0x400"
  1308. memory_channels: "2"
  1309. interface:
  1310. eth3:
  1311. enabled: true
  1312. type: eth
  1313. proto: manual
  1314. name: ${_param:tenant_first_nic}
  1315. eth4:
  1316. enabled: true
  1317. type: eth
  1318. proto: manual
  1319. name: ${_param:tenant_second_nic}
  1320. dpdk0:
  1321. name: ${_param:tenant_first_nic}
  1322. pci: "0000:81:00.0"
  1323. driver: igb_uio
  1324. bond: bond1
  1325. enabled: true
  1326. type: dpdk_ovs_port
  1327. n_rxq: 2
  1328. dpdk1:
  1329. name: ${_param:tenant_second_nic}
  1330. pci: "0000:81:00.1"
  1331. driver: igb_uio
  1332. bond: bond1
  1333. enabled: true
  1334. type: dpdk_ovs_port
  1335. n_rxq: 2
  1336. bond1:
  1337. enabled: true
  1338. bridge: br-prv
  1339. type: dpdk_ovs_bond
  1340. mode: balance-slb
  1341. br-prv:
  1342. enabled: true
  1343. type: dpdk_ovs_bridge
  1344. tag: ${_param:tenant_vlan}
  1345. address: ${_param:tenant_address}
  1346. netmask: ${_param:tenant_network_netmask}
  1347. **DPDK OVS bridge for VXLAN**
  1348. If VXLAN is used as tenant segmentation then ip address must be set on br-prv
  1349. .. code-block:: yaml
  1350. linux:
  1351. network:
  1352. ...
  1353. interface:
  1354. br-prv:
  1355. enabled: true
  1356. type: dpdk_ovs_bridge
  1357. address: 192.168.50.0
  1358. netmask: 255.255.255.0
  1359. tag: 101
  1360. mtu: 9000
  1361. **DPDK OVS bridge with Linux network interface**
  1362. .. code-block:: yaml
  1363. linux:
  1364. network:
  1365. ...
  1366. interface:
  1367. eth0:
  1368. type: eth
  1369. ovs_bridge: br-prv
  1370. ...
  1371. br-prv:
  1372. enabled: true
  1373. type: dpdk_ovs_bridge
  1374. ...
  1375. Linux storage
  1376. -------------
  1377. Linux with mounted Samba
  1378. .. code-block:: yaml
  1379. linux:
  1380. storage:
  1381. enabled: true
  1382. mount:
  1383. samba1:
  1384. - enabled: true
  1385. - path: /media/myuser/public/
  1386. - device: //192.168.0.1/storage
  1387. - file_system: cifs
  1388. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  1389. NFS mount
  1390. .. code-block:: yaml
  1391. linux:
  1392. storage:
  1393. enabled: true
  1394. mount:
  1395. nfs_glance:
  1396. enabled: true
  1397. path: /var/lib/glance/images
  1398. device: 172.16.10.110:/var/nfs/glance
  1399. file_system: nfs
  1400. opts: rw,sync
  1401. File swap configuration
  1402. .. code-block:: yaml
  1403. linux:
  1404. storage:
  1405. enabled: true
  1406. swap:
  1407. file:
  1408. enabled: true
  1409. engine: file
  1410. device: /swapfile
  1411. size: 1024
  1412. Partition swap configuration
  1413. .. code-block:: yaml
  1414. linux:
  1415. storage:
  1416. enabled: true
  1417. swap:
  1418. partition:
  1419. enabled: true
  1420. engine: partition
  1421. device: /dev/vg0/swap
  1422. LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
  1423. .. code-block:: yaml
  1424. parameters:
  1425. linux:
  1426. storage:
  1427. mount:
  1428. data:
  1429. enabled: true
  1430. device: /dev/vg1/data
  1431. file_system: ext4
  1432. path: /mnt/data
  1433. lvm:
  1434. vg1:
  1435. enabled: true
  1436. devices:
  1437. - /dev/sdb
  1438. volume:
  1439. data:
  1440. size: 40G
  1441. mount: ${linux:storage:mount:data}
  1442. Create partitions on disk. Specify size in MB. It expects empty
  1443. disk without any existing partitions. (set startsector=1, if you want to start partitions from 2048)
  1444. .. code-block:: yaml
  1445. linux:
  1446. storage:
  1447. disk:
  1448. first_drive:
  1449. startsector: 1
  1450. name: /dev/loop1
  1451. type: gpt
  1452. partitions:
  1453. - size: 200 #size in MB
  1454. type: fat32
  1455. - size: 300 #size in MB
  1456. mkfs: True
  1457. type: xfs
  1458. /dev/vda1:
  1459. partitions:
  1460. - size: 5
  1461. type: ext2
  1462. - size: 10
  1463. type: ext4
  1464. Multipath with Fujitsu Eternus DXL
  1465. .. code-block:: yaml
  1466. parameters:
  1467. linux:
  1468. storage:
  1469. multipath:
  1470. enabled: true
  1471. blacklist_devices:
  1472. - /dev/sda
  1473. - /dev/sdb
  1474. backends:
  1475. - fujitsu_eternus_dxl
  1476. Multipath with Hitachi VSP 1000
  1477. .. code-block:: yaml
  1478. parameters:
  1479. linux:
  1480. storage:
  1481. multipath:
  1482. enabled: true
  1483. blacklist_devices:
  1484. - /dev/sda
  1485. - /dev/sdb
  1486. backends:
  1487. - hitachi_vsp1000
  1488. Multipath with IBM Storwize
  1489. .. code-block:: yaml
  1490. parameters:
  1491. linux:
  1492. storage:
  1493. multipath:
  1494. enabled: true
  1495. blacklist_devices:
  1496. - /dev/sda
  1497. - /dev/sdb
  1498. backends:
  1499. - ibm_storwize
  1500. Multipath with multiple backends
  1501. .. code-block:: yaml
  1502. parameters:
  1503. linux:
  1504. storage:
  1505. multipath:
  1506. enabled: true
  1507. blacklist_devices:
  1508. - /dev/sda
  1509. - /dev/sdb
  1510. - /dev/sdc
  1511. - /dev/sdd
  1512. backends:
  1513. - ibm_storwize
  1514. - fujitsu_eternus_dxl
  1515. - hitachi_vsp1000
  1516. PAM LDAP integration
  1517. .. code-block:: yaml
  1518. parameters:
  1519. linux:
  1520. system:
  1521. auth:
  1522. enabled: true
  1523. mkhomedir:
  1524. enabled: true
  1525. umask: 0027
  1526. ldap:
  1527. enabled: true
  1528. binddn: cn=bind,ou=service_users,dc=example,dc=com
  1529. bindpw: secret
  1530. uri: ldap://127.0.0.1
  1531. base: ou=users,dc=example,dc=com
  1532. ldap_version: 3
  1533. pagesize: 65536
  1534. referrals: off
  1535. filter:
  1536. passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1537. shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1538. group: (&(objectClass=group)(gidNumber=*))
  1539. Disabled multipath (the default setup)
  1540. .. code-block:: yaml
  1541. parameters:
  1542. linux:
  1543. storage:
  1544. multipath:
  1545. enabled: false
  1546. Linux with local loopback device
  1547. .. code-block:: yaml
  1548. linux:
  1549. storage:
  1550. loopback:
  1551. disk1:
  1552. file: /srv/disk1
  1553. size: 50G
  1554. External config generation
  1555. --------------------------
  1556. You are able to use config support metadata between formulas and only generate
  1557. config files for external use, eg. docker, etc.
  1558. .. code-block:: yaml
  1559. parameters:
  1560. linux:
  1561. system:
  1562. config:
  1563. pillar:
  1564. jenkins:
  1565. master:
  1566. home: /srv/volumes/jenkins
  1567. approved_scripts:
  1568. - method java.net.URL openConnection
  1569. credentials:
  1570. - type: username_password
  1571. scope: global
  1572. id: test
  1573. desc: Testing credentials
  1574. username: test
  1575. password: test
  1576. Netconsole Remote Kernel Logging
  1577. --------------------------------
  1578. Netconsole logger could be configured for configfs-enabled kernels
  1579. (`CONFIG_NETCONSOLE_DYNAMIC` should be enabled). Configuration applies both in
  1580. runtime (if network is already configured), and on-boot after interface
  1581. initialization. Notes:
  1582. * receiver could be located only in same L3 domain
  1583. (or you need to configure gateway MAC manually)
  1584. * receiver's MAC is detected only on configuration time
  1585. * using broadcast MAC is not recommended
  1586. .. code-block:: yaml
  1587. parameters:
  1588. linux:
  1589. system:
  1590. netconsole:
  1591. enabled: true
  1592. port: 514 (optional)
  1593. loglevel: debug (optional)
  1594. target:
  1595. 192.168.0.1:
  1596. interface: bond0
  1597. mac: "ff:ff:ff:ff:ff:ff" (optional)
  1598. Usage
  1599. =====
  1600. Set mtu of network interface eth0 to 1400
  1601. .. code-block:: bash
  1602. ip link set dev eth0 mtu 1400
  1603. Read more
  1604. =========
  1605. * https://www.archlinux.org/
  1606. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
  1607. Documentation and Bugs
  1608. ======================
  1609. To learn how to install and update salt-formulas, consult the documentation
  1610. available online at:
  1611. http://salt-formulas.readthedocs.io/
  1612. In the unfortunate event that bugs are discovered, they should be reported to
  1613. the appropriate issue tracker. Use Github issue tracker for specific salt
  1614. formula:
  1615. https://github.com/salt-formulas/salt-formula-linux/issues
  1616. For feature requests, bug reports or blueprints affecting entire ecosystem,
  1617. use Launchpad salt-formulas project:
  1618. https://launchpad.net/salt-formulas
  1619. You can also join salt-formulas-users team and subscribe to mailing list:
  1620. https://launchpad.net/~salt-formulas-users
  1621. Developers wishing to work on the salt-formulas projects should always base
  1622. their work on master branch and submit pull request against specific formula.
  1623. https://github.com/salt-formulas/salt-formula-linux
  1624. Any questions or feedback is always welcome so feel free to join our IRC
  1625. channel:
  1626. #salt-formulas @ irc.freenode.net