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

README.rst 47KB

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