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 46KB

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