Saltstack Official Linux Formula
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

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