Saltstack Official Linux Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 7 roky
před 9 roky
před 7 roky
před 9 roky
před 7 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 7 roky
před 7 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 8 roky
před 8 roky
před 8 roky
před 8 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
před 7 roky
před 9 roky
před 9 roky
před 9 roky
před 9 roky
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006
  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. .. note:: For old ubuntu releases (<xenial)
  583. extra packages for apt transport, like ``apt-transport-https``
  584. may be required to be installed manually.
  585. (Chicken-eggs problem: we need to install packages to
  586. reach repo from where they should be installed)
  587. Otherwise, you still can try 'fortune' and install prereq.packages before
  588. any repo configuration, using list of requires in map.jinja.
  589. Disabling any prerequirment packages installation:
  590. You can simply drop any package pre-installation (before system.linux.repo
  591. will be processed) via cluster lvl:
  592. .. code-block:: yaml
  593. linux:
  594. system:
  595. pkgs: ~
  596. Package manager proxy setup globally:
  597. .. code-block:: yaml
  598. linux:
  599. system:
  600. ...
  601. repo:
  602. apt-mk:
  603. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  604. ...
  605. proxy:
  606. pkg:
  607. enabled: true
  608. ftp: ftp://ftp-proxy-for-apt.host.local:2121
  609. ...
  610. # NOTE: Global defaults for any other componet that configure proxy on the system.
  611. # If your environment has just one simple proxy, set it on linux:system:proxy.
  612. #
  613. # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
  614. # as for https and http
  615. ftp: ftp://proxy.host.local:2121
  616. http: http://proxy.host.local:3142
  617. https: https://proxy.host.local:3143
  618. Package manager proxy setup per repository:
  619. .. code-block:: yaml
  620. linux:
  621. system:
  622. ...
  623. repo:
  624. debian:
  625. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  626. ...
  627. apt-mk:
  628. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  629. # per repository proxy
  630. proxy:
  631. enabled: true
  632. http: http://maas-01:8080
  633. https: http://maas-01:8080
  634. ...
  635. proxy:
  636. # package manager fallback defaults
  637. # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
  638. pkg:
  639. enabled: true
  640. ftp: ftp://proxy.host.local:2121
  641. #http: http://proxy.host.local:3142
  642. #https: https://proxy.host.local:3143
  643. ...
  644. # global system fallback system defaults
  645. ftp: ftp://proxy.host.local:2121
  646. http: http://proxy.host.local:3142
  647. https: https://proxy.host.local:3143
  648. Remove all repositories:
  649. .. code-block:: yaml
  650. linux:
  651. system:
  652. purge_repos: true
  653. Refresh repositories metada, after configuration:
  654. .. code-block:: yaml
  655. linux:
  656. system:
  657. refresh_repos_meta: true
  658. Setup custom apt config options:
  659. .. code-block:: yaml
  660. linux:
  661. system:
  662. apt:
  663. config:
  664. compression-workaround:
  665. "Acquire::CompressionTypes::Order": "gz"
  666. docker-clean:
  667. "DPkg::Post-Invoke":
  668. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  669. "APT::Update::Post-Invoke":
  670. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  671. RC
  672. ~~
  673. rc.local example
  674. .. code-block:: yaml
  675. linux:
  676. system:
  677. rc:
  678. local: |
  679. #!/bin/sh -e
  680. #
  681. # rc.local
  682. #
  683. # This script is executed at the end of each multiuser runlevel.
  684. # Make sure that the script will "exit 0" on success or any other
  685. # value on error.
  686. #
  687. # In order to enable or disable this script just change the execution
  688. # bits.
  689. #
  690. # By default this script does nothing.
  691. exit 0
  692. Prompt
  693. ~~~~~~
  694. Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every
  695. user can have different prompt.
  696. .. code-block:: yaml
  697. linux:
  698. system:
  699. prompt:
  700. 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\\]
  701. default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
  702. On Debian systems to set prompt system-wide it's necessary to remove setting
  703. PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from
  704. ``/etc/skel/.bashrc``). This formula will do this automatically, but will not
  705. touch existing user's ``~/.bashrc`` files except root.
  706. Bash
  707. ~~~~
  708. Fix bash configuration to preserve history across sessions (like ZSH does by
  709. default).
  710. .. code-block:: yaml
  711. linux:
  712. system:
  713. bash:
  714. preserve_history: true
  715. Login banner message
  716. ~~~~~~~~~~~~~~~~~~~~
  717. /etc/issue is a text file which contains a message or system
  718. identification to be printed before the login prompt. It may contain
  719. various @char and \char sequences, if supported by the getty-type
  720. program employed on the system.
  721. Setting logon banner message is easy:
  722. .. code-block:: yaml
  723. liunx:
  724. system:
  725. banner:
  726. enabled: true
  727. contents: |
  728. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  729. You must have explicit, authorized permission to access or configure this
  730. device. Unauthorized attempts and actions to access or use this system may
  731. result in civil and/or criminal penalties.
  732. All activities performed on this system are logged and monitored.
  733. Message of the day
  734. ~~~~~~~~~~~~~~~~~~
  735. ``pam_motd`` from package ``libpam-modules`` is used for dynamic messages of the
  736. day. Setting custom motd will cleanup existing ones.
  737. Setting static motd will replace existing ``/etc/motd`` and remove scripts from
  738. ``/etc/update-motd.d``.
  739. Setting static motd:
  740. .. code-block:: yaml
  741. linux:
  742. system:
  743. motd: |
  744. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  745. You must have explicit, authorized permission to access or configure this
  746. device. Unauthorized attempts and actions to access or use this system may
  747. result in civil and/or criminal penalties.
  748. All activities performed on this system are logged and monitored.
  749. Setting dynamic motd:
  750. .. code-block:: yaml
  751. linux:
  752. system:
  753. motd:
  754. - release: |
  755. #!/bin/sh
  756. [ -r /etc/lsb-release ] && . /etc/lsb-release
  757. if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
  758. # Fall back to using the very slow lsb_release utility
  759. DISTRIB_DESCRIPTION=$(lsb_release -s -d)
  760. fi
  761. printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
  762. - warning: |
  763. #!/bin/sh
  764. printf "This is [company name] network.\n"
  765. printf "Unauthorized access strictly prohibited.\n"
  766. Services
  767. ~~~~~~~~
  768. Stop and disable linux service:
  769. .. code-block:: yaml
  770. linux:
  771. system:
  772. service:
  773. apt-daily.timer:
  774. status: dead
  775. Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.
  776. Linux with atop service:
  777. .. code-block:: yaml
  778. linux:
  779. system:
  780. atop:
  781. enabled: true
  782. interval: 20
  783. logpath: "/var/log/atop"
  784. outfile: "/var/log/atop/daily.log"
  785. Linux with mcelog service:
  786. .. code-block:: yaml
  787. linux:
  788. system:
  789. mcelog:
  790. enabled: true
  791. logging:
  792. syslog: true
  793. syslog_error: true
  794. RHEL / CentOS
  795. ^^^^^^^^^^^^^
  796. Unfortunately ``update-motd`` is currently not available for RHEL so there's
  797. no native support for dynamic motd.
  798. You can still set static one, only pillar structure differs:
  799. .. code-block:: yaml
  800. linux:
  801. system:
  802. motd: |
  803. This is [company name] network.
  804. Unauthorized access strictly prohibited.
  805. Haveged
  806. ~~~~~~~
  807. If you are running headless server and are low on entropy, it may be a good
  808. idea to setup Haveged.
  809. .. code-block:: yaml
  810. linux:
  811. system:
  812. haveged:
  813. enabled: true
  814. Linux network
  815. -------------
  816. Linux with network manager
  817. .. code-block:: yaml
  818. linux:
  819. network:
  820. enabled: true
  821. network_manager: true
  822. Linux with default static network interfaces, default gateway interface and DNS servers
  823. .. code-block:: yaml
  824. linux:
  825. network:
  826. enabled: true
  827. interface:
  828. eth0:
  829. enabled: true
  830. type: eth
  831. address: 192.168.0.102
  832. netmask: 255.255.255.0
  833. gateway: 192.168.0.1
  834. name_servers:
  835. - 8.8.8.8
  836. - 8.8.4.4
  837. mtu: 1500
  838. Linux with bonded interfaces and disabled NetworkManager
  839. .. code-block:: yaml
  840. linux:
  841. network:
  842. enabled: true
  843. interface:
  844. eth0:
  845. type: eth
  846. ...
  847. eth1:
  848. type: eth
  849. ...
  850. bond0:
  851. enabled: true
  852. type: bond
  853. address: 192.168.0.102
  854. netmask: 255.255.255.0
  855. mtu: 1500
  856. use_in:
  857. - interface: ${linux:interface:eth0}
  858. - interface: ${linux:interface:eth0}
  859. network_manager:
  860. disable: true
  861. Linux with vlan interface_params
  862. .. code-block:: yaml
  863. linux:
  864. network:
  865. enabled: true
  866. interface:
  867. vlan69:
  868. type: vlan
  869. use_interfaces:
  870. - interface: ${linux:interface:bond0}
  871. Linux with wireless interface parameters
  872. .. code-block:: yaml
  873. linux:
  874. network:
  875. enabled: true
  876. gateway: 10.0.0.1
  877. default_interface: eth0
  878. interface:
  879. wlan0:
  880. type: eth
  881. wireless:
  882. essid: example
  883. key: example_key
  884. security: wpa
  885. priority: 1
  886. Linux networks with routes defined
  887. .. code-block:: yaml
  888. linux:
  889. network:
  890. enabled: true
  891. gateway: 10.0.0.1
  892. default_interface: eth0
  893. interface:
  894. eth0:
  895. type: eth
  896. route:
  897. default:
  898. address: 192.168.0.123
  899. netmask: 255.255.255.0
  900. gateway: 192.168.0.1
  901. Native Linux Bridges
  902. .. code-block:: yaml
  903. linux:
  904. network:
  905. interface:
  906. eth1:
  907. enabled: true
  908. type: eth
  909. proto: manual
  910. up_cmds:
  911. - ip address add 0/0 dev $IFACE
  912. - ip link set $IFACE up
  913. down_cmds:
  914. - ip link set $IFACE down
  915. br-ex:
  916. enabled: true
  917. type: bridge
  918. address: ${linux:network:host:public_local:address}
  919. netmask: 255.255.255.0
  920. use_interfaces:
  921. - eth1
  922. OpenVswitch Bridges
  923. .. code-block:: yaml
  924. linux:
  925. network:
  926. bridge: openvswitch
  927. interface:
  928. eth1:
  929. enabled: true
  930. type: eth
  931. proto: manual
  932. up_cmds:
  933. - ip address add 0/0 dev $IFACE
  934. - ip link set $IFACE up
  935. down_cmds:
  936. - ip link set $IFACE down
  937. br-ex:
  938. enabled: true
  939. type: bridge
  940. address: ${linux:network:host:public_local:address}
  941. netmask: 255.255.255.0
  942. use_interfaces:
  943. - eth1
  944. br-prv:
  945. enabled: true
  946. type: ovs_bridge
  947. mtu: 65000
  948. br-ens7:
  949. enabled: true
  950. name: br-ens7
  951. type: ovs_bridge
  952. proto: manual
  953. mtu: 9000
  954. use_interfaces:
  955. - ens7
  956. patch-br-ens7-br-prv:
  957. enabled: true
  958. name: ens7-prv
  959. ovs_type: ovs_port
  960. type: ovs_port
  961. bridge: br-ens7
  962. port_type: patch
  963. peer: prv-ens7
  964. tag: 109 # [] to unset a tag
  965. mtu: 65000
  966. patch-br-prv-br-ens7:
  967. enabled: true
  968. name: prv-ens7
  969. bridge: br-prv
  970. ovs_type: ovs_port
  971. type: ovs_port
  972. port_type: patch
  973. peer: ens7-prv
  974. tag: 109
  975. mtu: 65000
  976. ens7:
  977. enabled: true
  978. name: ens7
  979. proto: manual
  980. ovs_port_type: OVSPort
  981. type: ovs_port
  982. ovs_bridge: br-ens7
  983. bridge: br-ens7
  984. Debian manual proto interfaces
  985. When you are changing interface proto from static in up state to manual, you
  986. may need to flush ip addresses. For example, if you want to use the interface
  987. and the ip on the bridge. This can be done by setting the ``ipflush_onchange``
  988. to true.
  989. .. code-block:: yaml
  990. linux:
  991. network:
  992. interface:
  993. eth1:
  994. enabled: true
  995. type: eth
  996. proto: manual
  997. mtu: 9100
  998. ipflush_onchange: true
  999. Debian static proto interfaces
  1000. When you are changing interface proto from dhcp in up state to static, you
  1001. may need to flush ip addresses and restart interface to assign ip address from a managed file.
  1002. For example, if you want to use the interface and the ip on the bridge.
  1003. This can be done by setting the ``ipflush_onchange`` with combination
  1004. ``restart_on_ipflush`` param set to to true.
  1005. .. code-block:: yaml
  1006. linux:
  1007. network:
  1008. interface:
  1009. eth1:
  1010. enabled: true
  1011. type: eth
  1012. proto: static
  1013. address: 10.1.0.22
  1014. netmask: 255.255.255.0
  1015. ipflush_onchange: true
  1016. restart_on_ipflush: true
  1017. Concatinating and removing interface files
  1018. Debian based distributions have `/etc/network/interfaces.d/` directory, where
  1019. you can store configuration of network interfaces in separate files. You can
  1020. concatinate the files to the defined destination when needed, this operation
  1021. removes the file from the `/etc/network/interfaces.d/`. If you just need to
  1022. remove iface files, you can use the `remove_iface_files` key.
  1023. .. code-block:: yaml
  1024. linux:
  1025. network:
  1026. concat_iface_files:
  1027. - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
  1028. dst: '/etc/network/interfaces'
  1029. remove_iface_files:
  1030. - '/etc/network/interfaces.d/90-custom.cfg'
  1031. DHCP client configuration
  1032. None of the keys is mandatory, include only those you really need. For full list
  1033. of available options under send, supersede, prepend, append refer to dhcp-options(5)
  1034. .. code-block:: yaml
  1035. linux:
  1036. network:
  1037. dhclient:
  1038. enabled: true
  1039. backoff_cutoff: 15
  1040. initial_interval: 10
  1041. reboot: 10
  1042. retry: 60
  1043. select_timeout: 0
  1044. timeout: 120
  1045. send:
  1046. - option: host-name
  1047. declaration: "= gethostname()"
  1048. supersede:
  1049. - option: host-name
  1050. declaration: "spaceship"
  1051. - option: domain-name
  1052. declaration: "domain.home"
  1053. #- option: arp-cache-timeout
  1054. # declaration: 20
  1055. prepend:
  1056. - option: domain-name-servers
  1057. declaration:
  1058. - 8.8.8.8
  1059. - 8.8.4.4
  1060. - option: domain-search
  1061. declaration:
  1062. - example.com
  1063. - eng.example.com
  1064. #append:
  1065. #- option: domain-name-servers
  1066. # declaration: 127.0.0.1
  1067. # ip or subnet to reject dhcp offer from
  1068. reject:
  1069. - 192.33.137.209
  1070. - 10.0.2.0/24
  1071. request:
  1072. - subnet-mask
  1073. - broadcast-address
  1074. - time-offset
  1075. - routers
  1076. - domain-name
  1077. - domain-name-servers
  1078. - domain-search
  1079. - host-name
  1080. - dhcp6.name-servers
  1081. - dhcp6.domain-search
  1082. - dhcp6.fqdn
  1083. - dhcp6.sntp-servers
  1084. - netbios-name-servers
  1085. - netbios-scope
  1086. - interface-mtu
  1087. - rfc3442-classless-static-routes
  1088. - ntp-servers
  1089. require:
  1090. - subnet-mask
  1091. - domain-name-servers
  1092. # if per interface configuration required add below
  1093. interface:
  1094. ens2:
  1095. initial_interval: 11
  1096. reject:
  1097. - 192.33.137.210
  1098. ens3:
  1099. initial_interval: 12
  1100. reject:
  1101. - 192.33.137.211
  1102. Linux network systemd settings:
  1103. .. code-block:: yaml
  1104. linux:
  1105. network:
  1106. ...
  1107. systemd:
  1108. link:
  1109. 10-iface-dmz:
  1110. Match:
  1111. MACAddress: c8:5b:67:fa:1a:af
  1112. OriginalName: eth0
  1113. Link:
  1114. Name: dmz0
  1115. netdev:
  1116. 20-bridge-dmz:
  1117. match:
  1118. name: dmz0
  1119. network:
  1120. mescription: bridge
  1121. bridge: br-dmz0
  1122. network:
  1123. # works with lowercase, keys are by default capitalized
  1124. 40-dhcp:
  1125. match:
  1126. name: '*'
  1127. network:
  1128. DHCP: yes
  1129. Configure global environment variables
  1130. Use ``/etc/environment`` for static system wide variable assignment after
  1131. boot. Variable expansion is frequently not supported.
  1132. .. code-block:: yaml
  1133. linux:
  1134. system:
  1135. env:
  1136. BOB_VARIABLE: Alice
  1137. ...
  1138. BOB_PATH:
  1139. - /srv/alice/bin
  1140. - /srv/bob/bin
  1141. ...
  1142. ftp_proxy: none
  1143. http_proxy: http://global-http-proxy.host.local:8080
  1144. https_proxy: ${linux:system:proxy:https}
  1145. no_proxy:
  1146. - 192.168.0.80
  1147. - 192.168.1.80
  1148. - .domain.com
  1149. - .local
  1150. ...
  1151. # NOTE: global defaults proxy configuration.
  1152. proxy:
  1153. ftp: ftp://proxy.host.local:2121
  1154. http: http://proxy.host.local:3142
  1155. https: https://proxy.host.local:3143
  1156. noproxy:
  1157. - .domain.com
  1158. - .local
  1159. Configure profile.d scripts
  1160. The profile.d scripts are being sourced during .sh execution and support
  1161. variable expansion in opposite to /etc/environment global settings in
  1162. ``/etc/environment``.
  1163. .. code-block:: yaml
  1164. linux:
  1165. system:
  1166. profile:
  1167. locales: |
  1168. export LANG=C
  1169. export LC_ALL=C
  1170. ...
  1171. vi_flavors.sh: |
  1172. export PAGER=view
  1173. export EDITOR=vim
  1174. alias vi=vim
  1175. shell_locales.sh: |
  1176. export LANG=en_US
  1177. export LC_ALL=en_US.UTF-8
  1178. shell_proxies.sh: |
  1179. export FTP_PROXY=ftp://127.0.3.3:2121
  1180. export NO_PROXY='.local'
  1181. Linux with hosts
  1182. Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
  1183. that are not defined in model except defaults for both IPv4 and IPv6 localhost
  1184. and hostname + fqdn.
  1185. It's good to use this option if you want to ensure /etc/hosts is always in a
  1186. clean state however it's not enabled by default for safety.
  1187. .. code-block:: yaml
  1188. linux:
  1189. network:
  1190. purge_hosts: true
  1191. host:
  1192. # No need to define this one if purge_hosts is true
  1193. hostname:
  1194. address: 127.0.1.1
  1195. names:
  1196. - ${linux:network:fqdn}
  1197. - ${linux:network:hostname}
  1198. node1:
  1199. address: 192.168.10.200
  1200. names:
  1201. - node2.domain.com
  1202. - service2.domain.com
  1203. node2:
  1204. address: 192.168.10.201
  1205. names:
  1206. - node2.domain.com
  1207. - service2.domain.com
  1208. Linux with hosts collected from mine
  1209. In this case all dns records defined within infrastrucuture will be passed to
  1210. local hosts records or any DNS server. Only hosts with `grain` parameter to
  1211. true will be propagated to the mine.
  1212. .. code-block:: yaml
  1213. linux:
  1214. network:
  1215. purge_hosts: true
  1216. mine_dns_records: true
  1217. host:
  1218. node1:
  1219. address: 192.168.10.200
  1220. grain: true
  1221. names:
  1222. - node2.domain.com
  1223. - service2.domain.com
  1224. Setup resolv.conf, nameservers, domain and search domains
  1225. .. code-block:: yaml
  1226. linux:
  1227. network:
  1228. resolv:
  1229. dns:
  1230. - 8.8.4.4
  1231. - 8.8.8.8
  1232. domain: my.example.com
  1233. search:
  1234. - my.example.com
  1235. - example.com
  1236. options:
  1237. - ndots: 5
  1238. - timeout: 2
  1239. - attempts: 2
  1240. setting custom TX queue length for tap interfaces
  1241. .. code-block:: yaml
  1242. linux:
  1243. network:
  1244. tap_custom_txqueuelen: 10000
  1245. DPDK OVS interfaces
  1246. **DPDK OVS NIC**
  1247. .. code-block:: yaml
  1248. linux:
  1249. network:
  1250. bridge: openvswitch
  1251. dpdk:
  1252. enabled: true
  1253. driver: uio/vfio
  1254. openvswitch:
  1255. pmd_cpu_mask: "0x6"
  1256. dpdk_socket_mem: "1024,1024"
  1257. dpdk_lcore_mask: "0x400"
  1258. memory_channels: 2
  1259. interface:
  1260. dpkd0:
  1261. name: ${_param:dpdk_nic}
  1262. pci: 0000:06:00.0
  1263. driver: igb_uio/vfio-pci
  1264. enabled: true
  1265. type: dpdk_ovs_port
  1266. n_rxq: 2
  1267. pmd_rxq_affinity: "0:1,1:2"
  1268. bridge: br-prv
  1269. mtu: 9000
  1270. br-prv:
  1271. enabled: true
  1272. type: dpdk_ovs_bridge
  1273. **DPDK OVS Bond**
  1274. .. code-block:: yaml
  1275. linux:
  1276. network:
  1277. bridge: openvswitch
  1278. dpdk:
  1279. enabled: true
  1280. driver: uio/vfio
  1281. openvswitch:
  1282. pmd_cpu_mask: "0x6"
  1283. dpdk_socket_mem: "1024,1024"
  1284. dpdk_lcore_mask: "0x400"
  1285. memory_channels: 2
  1286. interface:
  1287. dpdk_second_nic:
  1288. name: ${_param:primary_second_nic}
  1289. pci: 0000:06:00.0
  1290. driver: igb_uio/vfio-pci
  1291. bond: dpdkbond0
  1292. enabled: true
  1293. type: dpdk_ovs_port
  1294. n_rxq: 2
  1295. pmd_rxq_affinity: "0:1,1:2"
  1296. mtu: 9000
  1297. dpdk_first_nic:
  1298. name: ${_param:primary_first_nic}
  1299. pci: 0000:05:00.0
  1300. driver: igb_uio/vfio-pci
  1301. bond: dpdkbond0
  1302. enabled: true
  1303. type: dpdk_ovs_port
  1304. n_rxq: 2
  1305. pmd_rxq_affinity: "0:1,1:2"
  1306. mtu: 9000
  1307. dpdkbond0:
  1308. enabled: true
  1309. bridge: br-prv
  1310. type: dpdk_ovs_bond
  1311. mode: active-backup
  1312. br-prv:
  1313. enabled: true
  1314. type: dpdk_ovs_bridge
  1315. **DPDK OVS LACP Bond with vlan tag**
  1316. .. code-block:: yaml
  1317. linux:
  1318. network:
  1319. bridge: openvswitch
  1320. dpdk:
  1321. enabled: true
  1322. driver: uio
  1323. openvswitch:
  1324. pmd_cpu_mask: "0x6"
  1325. dpdk_socket_mem: "1024,1024"
  1326. dpdk_lcore_mask: "0x400"
  1327. memory_channels: "2"
  1328. interface:
  1329. eth3:
  1330. enabled: true
  1331. type: eth
  1332. proto: manual
  1333. name: ${_param:tenant_first_nic}
  1334. eth4:
  1335. enabled: true
  1336. type: eth
  1337. proto: manual
  1338. name: ${_param:tenant_second_nic}
  1339. dpdk0:
  1340. name: ${_param:tenant_first_nic}
  1341. pci: "0000:81:00.0"
  1342. driver: igb_uio
  1343. bond: bond1
  1344. enabled: true
  1345. type: dpdk_ovs_port
  1346. n_rxq: 2
  1347. dpdk1:
  1348. name: ${_param:tenant_second_nic}
  1349. pci: "0000:81:00.1"
  1350. driver: igb_uio
  1351. bond: bond1
  1352. enabled: true
  1353. type: dpdk_ovs_port
  1354. n_rxq: 2
  1355. bond1:
  1356. enabled: true
  1357. bridge: br-prv
  1358. type: dpdk_ovs_bond
  1359. mode: balance-slb
  1360. br-prv:
  1361. enabled: true
  1362. type: dpdk_ovs_bridge
  1363. tag: ${_param:tenant_vlan}
  1364. address: ${_param:tenant_address}
  1365. netmask: ${_param:tenant_network_netmask}
  1366. **DPDK OVS bridge for VXLAN**
  1367. If VXLAN is used as tenant segmentation then ip address must be set on br-prv
  1368. .. code-block:: yaml
  1369. linux:
  1370. network:
  1371. ...
  1372. interface:
  1373. br-prv:
  1374. enabled: true
  1375. type: dpdk_ovs_bridge
  1376. address: 192.168.50.0
  1377. netmask: 255.255.255.0
  1378. tag: 101
  1379. mtu: 9000
  1380. **DPDK OVS bridge with Linux network interface**
  1381. .. code-block:: yaml
  1382. linux:
  1383. network:
  1384. ...
  1385. interface:
  1386. eth0:
  1387. type: eth
  1388. ovs_bridge: br-prv
  1389. ...
  1390. br-prv:
  1391. enabled: true
  1392. type: dpdk_ovs_bridge
  1393. ...
  1394. Linux storage
  1395. -------------
  1396. Linux with mounted Samba
  1397. .. code-block:: yaml
  1398. linux:
  1399. storage:
  1400. enabled: true
  1401. mount:
  1402. samba1:
  1403. - enabled: true
  1404. - path: /media/myuser/public/
  1405. - device: //192.168.0.1/storage
  1406. - file_system: cifs
  1407. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  1408. NFS mount
  1409. .. code-block:: yaml
  1410. linux:
  1411. storage:
  1412. enabled: true
  1413. mount:
  1414. nfs_glance:
  1415. enabled: true
  1416. path: /var/lib/glance/images
  1417. device: 172.16.10.110:/var/nfs/glance
  1418. file_system: nfs
  1419. opts: rw,sync
  1420. File swap configuration
  1421. .. code-block:: yaml
  1422. linux:
  1423. storage:
  1424. enabled: true
  1425. swap:
  1426. file:
  1427. enabled: true
  1428. engine: file
  1429. device: /swapfile
  1430. size: 1024
  1431. Partition swap configuration
  1432. .. code-block:: yaml
  1433. linux:
  1434. storage:
  1435. enabled: true
  1436. swap:
  1437. partition:
  1438. enabled: true
  1439. engine: partition
  1440. device: /dev/vg0/swap
  1441. LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
  1442. .. code-block:: yaml
  1443. parameters:
  1444. linux:
  1445. storage:
  1446. mount:
  1447. data:
  1448. enabled: true
  1449. device: /dev/vg1/data
  1450. file_system: ext4
  1451. path: /mnt/data
  1452. lvm:
  1453. vg1:
  1454. enabled: true
  1455. devices:
  1456. - /dev/sdb
  1457. volume:
  1458. data:
  1459. size: 40G
  1460. mount: ${linux:storage:mount:data}
  1461. Create partitions on disk. Specify size in MB. It expects empty
  1462. disk without any existing partitions. (set startsector=1, if you want to start partitions from 2048)
  1463. .. code-block:: yaml
  1464. linux:
  1465. storage:
  1466. disk:
  1467. first_drive:
  1468. startsector: 1
  1469. name: /dev/loop1
  1470. type: gpt
  1471. partitions:
  1472. - size: 200 #size in MB
  1473. type: fat32
  1474. - size: 300 #size in MB
  1475. mkfs: True
  1476. type: xfs
  1477. /dev/vda1:
  1478. partitions:
  1479. - size: 5
  1480. type: ext2
  1481. - size: 10
  1482. type: ext4
  1483. Multipath with Fujitsu Eternus DXL
  1484. .. code-block:: yaml
  1485. parameters:
  1486. linux:
  1487. storage:
  1488. multipath:
  1489. enabled: true
  1490. blacklist_devices:
  1491. - /dev/sda
  1492. - /dev/sdb
  1493. backends:
  1494. - fujitsu_eternus_dxl
  1495. Multipath with Hitachi VSP 1000
  1496. .. code-block:: yaml
  1497. parameters:
  1498. linux:
  1499. storage:
  1500. multipath:
  1501. enabled: true
  1502. blacklist_devices:
  1503. - /dev/sda
  1504. - /dev/sdb
  1505. backends:
  1506. - hitachi_vsp1000
  1507. Multipath with IBM Storwize
  1508. .. code-block:: yaml
  1509. parameters:
  1510. linux:
  1511. storage:
  1512. multipath:
  1513. enabled: true
  1514. blacklist_devices:
  1515. - /dev/sda
  1516. - /dev/sdb
  1517. backends:
  1518. - ibm_storwize
  1519. Multipath with multiple backends
  1520. .. code-block:: yaml
  1521. parameters:
  1522. linux:
  1523. storage:
  1524. multipath:
  1525. enabled: true
  1526. blacklist_devices:
  1527. - /dev/sda
  1528. - /dev/sdb
  1529. - /dev/sdc
  1530. - /dev/sdd
  1531. backends:
  1532. - ibm_storwize
  1533. - fujitsu_eternus_dxl
  1534. - hitachi_vsp1000
  1535. PAM LDAP integration
  1536. .. code-block:: yaml
  1537. parameters:
  1538. linux:
  1539. system:
  1540. auth:
  1541. enabled: true
  1542. mkhomedir:
  1543. enabled: true
  1544. umask: 0027
  1545. ldap:
  1546. enabled: true
  1547. binddn: cn=bind,ou=service_users,dc=example,dc=com
  1548. bindpw: secret
  1549. uri: ldap://127.0.0.1
  1550. base: ou=users,dc=example,dc=com
  1551. ldap_version: 3
  1552. pagesize: 65536
  1553. referrals: off
  1554. filter:
  1555. passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1556. shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1557. group: (&(objectClass=group)(gidNumber=*))
  1558. Disabled multipath (the default setup)
  1559. .. code-block:: yaml
  1560. parameters:
  1561. linux:
  1562. storage:
  1563. multipath:
  1564. enabled: false
  1565. Linux with local loopback device
  1566. .. code-block:: yaml
  1567. linux:
  1568. storage:
  1569. loopback:
  1570. disk1:
  1571. file: /srv/disk1
  1572. size: 50G
  1573. External config generation
  1574. --------------------------
  1575. You are able to use config support metadata between formulas and only generate
  1576. config files for external use, eg. docker, etc.
  1577. .. code-block:: yaml
  1578. parameters:
  1579. linux:
  1580. system:
  1581. config:
  1582. pillar:
  1583. jenkins:
  1584. master:
  1585. home: /srv/volumes/jenkins
  1586. approved_scripts:
  1587. - method java.net.URL openConnection
  1588. credentials:
  1589. - type: username_password
  1590. scope: global
  1591. id: test
  1592. desc: Testing credentials
  1593. username: test
  1594. password: test
  1595. Netconsole Remote Kernel Logging
  1596. --------------------------------
  1597. Netconsole logger could be configured for configfs-enabled kernels
  1598. (`CONFIG_NETCONSOLE_DYNAMIC` should be enabled). Configuration applies both in
  1599. runtime (if network is already configured), and on-boot after interface
  1600. initialization. Notes:
  1601. * receiver could be located only in same L3 domain
  1602. (or you need to configure gateway MAC manually)
  1603. * receiver's MAC is detected only on configuration time
  1604. * using broadcast MAC is not recommended
  1605. .. code-block:: yaml
  1606. parameters:
  1607. linux:
  1608. system:
  1609. netconsole:
  1610. enabled: true
  1611. port: 514 (optional)
  1612. loglevel: debug (optional)
  1613. target:
  1614. 192.168.0.1:
  1615. interface: bond0
  1616. mac: "ff:ff:ff:ff:ff:ff" (optional)
  1617. Usage
  1618. =====
  1619. Set mtu of network interface eth0 to 1400
  1620. .. code-block:: bash
  1621. ip link set dev eth0 mtu 1400
  1622. Read more
  1623. =========
  1624. * https://www.archlinux.org/
  1625. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
  1626. Documentation and Bugs
  1627. ======================
  1628. To learn how to install and update salt-formulas, consult the documentation
  1629. available online at:
  1630. http://salt-formulas.readthedocs.io/
  1631. In the unfortunate event that bugs are discovered, they should be reported to
  1632. the appropriate issue tracker. Use Github issue tracker for specific salt
  1633. formula:
  1634. https://github.com/salt-formulas/salt-formula-linux/issues
  1635. For feature requests, bug reports or blueprints affecting entire ecosystem,
  1636. use Launchpad salt-formulas project:
  1637. https://launchpad.net/salt-formulas
  1638. You can also join salt-formulas-users team and subscribe to mailing list:
  1639. https://launchpad.net/~salt-formulas-users
  1640. Developers wishing to work on the salt-formulas projects should always base
  1641. their work on master branch and submit pull request against specific formula.
  1642. https://github.com/salt-formulas/salt-formula-linux
  1643. Any questions or feedback is always welcome so feel free to join our IRC
  1644. channel:
  1645. #salt-formulas @ irc.freenode.net