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

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
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931
  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 false
  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. RHEL / CentOS
  742. ^^^^^^^^^^^^^
  743. Unfortunately ``update-motd`` is currently not available for RHEL so there's
  744. no native support for dynamic motd.
  745. You can still set static one, only pillar structure differs:
  746. .. code-block:: yaml
  747. linux:
  748. system:
  749. motd: |
  750. This is [company name] network.
  751. Unauthorized access strictly prohibited.
  752. Haveged
  753. ~~~~~~~
  754. If you are running headless server and are low on entropy, it may be a good
  755. idea to setup Haveged.
  756. .. code-block:: yaml
  757. linux:
  758. system:
  759. haveged:
  760. enabled: true
  761. Linux network
  762. -------------
  763. Linux with network manager
  764. .. code-block:: yaml
  765. linux:
  766. network:
  767. enabled: true
  768. network_manager: true
  769. Linux with default static network interfaces, default gateway interface and DNS servers
  770. .. code-block:: yaml
  771. linux:
  772. network:
  773. enabled: true
  774. interface:
  775. eth0:
  776. enabled: true
  777. type: eth
  778. address: 192.168.0.102
  779. netmask: 255.255.255.0
  780. gateway: 192.168.0.1
  781. name_servers:
  782. - 8.8.8.8
  783. - 8.8.4.4
  784. mtu: 1500
  785. Linux with bonded interfaces and disabled NetworkManager
  786. .. code-block:: yaml
  787. linux:
  788. network:
  789. enabled: true
  790. interface:
  791. eth0:
  792. type: eth
  793. ...
  794. eth1:
  795. type: eth
  796. ...
  797. bond0:
  798. enabled: true
  799. type: bond
  800. address: 192.168.0.102
  801. netmask: 255.255.255.0
  802. mtu: 1500
  803. use_in:
  804. - interface: ${linux:interface:eth0}
  805. - interface: ${linux:interface:eth0}
  806. network_manager:
  807. disable: true
  808. Linux with vlan interface_params
  809. .. code-block:: yaml
  810. linux:
  811. network:
  812. enabled: true
  813. interface:
  814. vlan69:
  815. type: vlan
  816. use_interfaces:
  817. - interface: ${linux:interface:bond0}
  818. Linux with wireless interface parameters
  819. .. code-block:: yaml
  820. linux:
  821. network:
  822. enabled: true
  823. gateway: 10.0.0.1
  824. default_interface: eth0
  825. interface:
  826. wlan0:
  827. type: eth
  828. wireless:
  829. essid: example
  830. key: example_key
  831. security: wpa
  832. priority: 1
  833. Linux networks with routes defined
  834. .. code-block:: yaml
  835. linux:
  836. network:
  837. enabled: true
  838. gateway: 10.0.0.1
  839. default_interface: eth0
  840. interface:
  841. eth0:
  842. type: eth
  843. route:
  844. default:
  845. address: 192.168.0.123
  846. netmask: 255.255.255.0
  847. gateway: 192.168.0.1
  848. Native Linux Bridges
  849. .. code-block:: yaml
  850. linux:
  851. network:
  852. interface:
  853. eth1:
  854. enabled: true
  855. type: eth
  856. proto: manual
  857. up_cmds:
  858. - ip address add 0/0 dev $IFACE
  859. - ip link set $IFACE up
  860. down_cmds:
  861. - ip link set $IFACE down
  862. br-ex:
  863. enabled: true
  864. type: bridge
  865. address: ${linux:network:host:public_local:address}
  866. netmask: 255.255.255.0
  867. use_interfaces:
  868. - eth1
  869. OpenVswitch Bridges
  870. .. code-block:: yaml
  871. linux:
  872. network:
  873. bridge: openvswitch
  874. interface:
  875. eth1:
  876. enabled: true
  877. type: eth
  878. proto: manual
  879. up_cmds:
  880. - ip address add 0/0 dev $IFACE
  881. - ip link set $IFACE up
  882. down_cmds:
  883. - ip link set $IFACE down
  884. br-ex:
  885. enabled: true
  886. type: bridge
  887. address: ${linux:network:host:public_local:address}
  888. netmask: 255.255.255.0
  889. use_interfaces:
  890. - eth1
  891. br-prv:
  892. enabled: true
  893. type: ovs_bridge
  894. mtu: 65000
  895. br-ens7:
  896. enabled: true
  897. name: br-ens7
  898. type: ovs_bridge
  899. proto: manual
  900. mtu: 9000
  901. use_interfaces:
  902. - ens7
  903. patch-br-ens7-br-prv:
  904. enabled: true
  905. name: ens7-prv
  906. ovs_type: ovs_port
  907. type: ovs_port
  908. bridge: br-ens7
  909. port_type: patch
  910. peer: prv-ens7
  911. mtu: 65000
  912. patch-br-prv-br-ens7:
  913. enabled: true
  914. name: prv-ens7
  915. bridge: br-prv
  916. ovs_type: ovs_port
  917. type: ovs_port
  918. port_type: patch
  919. peer: ens7-prv
  920. mtu: 65000
  921. ens7:
  922. enabled: true
  923. name: ens7
  924. proto: manual
  925. ovs_port_type: OVSPort
  926. type: ovs_port
  927. ovs_bridge: br-ens7
  928. bridge: br-ens7
  929. Debian manual proto interfaces
  930. When you are changing interface proto from static in up state to manual, you
  931. may need to flush ip addresses. For example, if you want to use the interface
  932. and the ip on the bridge. This can be done by setting the ``ipflush_onchange``
  933. to true.
  934. .. code-block:: yaml
  935. linux:
  936. network:
  937. interface:
  938. eth1:
  939. enabled: true
  940. type: eth
  941. proto: manual
  942. mtu: 9100
  943. ipflush_onchange: true
  944. Debian static proto interfaces
  945. When you are changing interface proto from dhcp in up state to static, you
  946. may need to flush ip addresses and restart interface to assign ip address from a managed file.
  947. For example, if you want to use the interface and the ip on the bridge.
  948. This can be done by setting the ``ipflush_onchange`` with combination
  949. ``restart_on_ipflush`` param set to to true.
  950. .. code-block:: yaml
  951. linux:
  952. network:
  953. interface:
  954. eth1:
  955. enabled: true
  956. type: eth
  957. proto: static
  958. address: 10.1.0.22
  959. netmask: 255.255.255.0
  960. ipflush_onchange: true
  961. restart_on_ipflush: true
  962. Concatinating and removing interface files
  963. Debian based distributions have `/etc/network/interfaces.d/` directory, where
  964. you can store configuration of network interfaces in separate files. You can
  965. concatinate the files to the defined destination when needed, this operation
  966. removes the file from the `/etc/network/interfaces.d/`. If you just need to
  967. remove iface files, you can use the `remove_iface_files` key.
  968. .. code-block:: yaml
  969. linux:
  970. network:
  971. concat_iface_files:
  972. - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
  973. dst: '/etc/network/interfaces'
  974. remove_iface_files:
  975. - '/etc/network/interfaces.d/90-custom.cfg'
  976. DHCP client configuration
  977. None of the keys is mandatory, include only those you really need. For full list
  978. of available options under send, supersede, prepend, append refer to dhcp-options(5)
  979. .. code-block:: yaml
  980. linux:
  981. network:
  982. dhclient:
  983. enabled: true
  984. backoff_cutoff: 15
  985. initial_interval: 10
  986. reboot: 10
  987. retry: 60
  988. select_timeout: 0
  989. timeout: 120
  990. send:
  991. - option: host-name
  992. declaration: "= gethostname()"
  993. supersede:
  994. - option: host-name
  995. declaration: "spaceship"
  996. - option: domain-name
  997. declaration: "domain.home"
  998. #- option: arp-cache-timeout
  999. # declaration: 20
  1000. prepend:
  1001. - option: domain-name-servers
  1002. declaration:
  1003. - 8.8.8.8
  1004. - 8.8.4.4
  1005. - option: domain-search
  1006. declaration:
  1007. - example.com
  1008. - eng.example.com
  1009. #append:
  1010. #- option: domain-name-servers
  1011. # declaration: 127.0.0.1
  1012. # ip or subnet to reject dhcp offer from
  1013. reject:
  1014. - 192.33.137.209
  1015. - 10.0.2.0/24
  1016. request:
  1017. - subnet-mask
  1018. - broadcast-address
  1019. - time-offset
  1020. - routers
  1021. - domain-name
  1022. - domain-name-servers
  1023. - domain-search
  1024. - host-name
  1025. - dhcp6.name-servers
  1026. - dhcp6.domain-search
  1027. - dhcp6.fqdn
  1028. - dhcp6.sntp-servers
  1029. - netbios-name-servers
  1030. - netbios-scope
  1031. - interface-mtu
  1032. - rfc3442-classless-static-routes
  1033. - ntp-servers
  1034. require:
  1035. - subnet-mask
  1036. - domain-name-servers
  1037. # if per interface configuration required add below
  1038. interface:
  1039. ens2:
  1040. initial_interval: 11
  1041. reject:
  1042. - 192.33.137.210
  1043. ens3:
  1044. initial_interval: 12
  1045. reject:
  1046. - 192.33.137.211
  1047. Linux network systemd settings:
  1048. .. code-block:: yaml
  1049. linux:
  1050. network:
  1051. ...
  1052. systemd:
  1053. link:
  1054. 10-iface-dmz:
  1055. Match:
  1056. MACAddress: c8:5b:67:fa:1a:af
  1057. OriginalName: eth0
  1058. Link:
  1059. Name: dmz0
  1060. netdev:
  1061. 20-bridge-dmz:
  1062. match:
  1063. name: dmz0
  1064. network:
  1065. mescription: bridge
  1066. bridge: br-dmz0
  1067. network:
  1068. # works with lowercase, keys are by default capitalized
  1069. 40-dhcp:
  1070. match:
  1071. name: '*'
  1072. network:
  1073. DHCP: yes
  1074. Configure global environment variables
  1075. Use ``/etc/environment`` for static system wide variable assignment after
  1076. boot. Variable expansion is frequently not supported.
  1077. .. code-block:: yaml
  1078. linux:
  1079. system:
  1080. env:
  1081. BOB_VARIABLE: Alice
  1082. ...
  1083. BOB_PATH:
  1084. - /srv/alice/bin
  1085. - /srv/bob/bin
  1086. ...
  1087. ftp_proxy: none
  1088. http_proxy: http://global-http-proxy.host.local:8080
  1089. https_proxy: ${linux:system:proxy:https}
  1090. no_proxy:
  1091. - 192.168.0.80
  1092. - 192.168.1.80
  1093. - .domain.com
  1094. - .local
  1095. ...
  1096. # NOTE: global defaults proxy configuration.
  1097. proxy:
  1098. ftp: ftp://proxy.host.local:2121
  1099. http: http://proxy.host.local:3142
  1100. https: https://proxy.host.local:3143
  1101. noproxy:
  1102. - .domain.com
  1103. - .local
  1104. Configure profile.d scripts
  1105. The profile.d scripts are being sourced during .sh execution and support
  1106. variable expansion in opposite to /etc/environment global settings in
  1107. ``/etc/environment``.
  1108. .. code-block:: yaml
  1109. linux:
  1110. system:
  1111. profile:
  1112. locales: |
  1113. export LANG=C
  1114. export LC_ALL=C
  1115. ...
  1116. vi_flavors.sh: |
  1117. export PAGER=view
  1118. export EDITOR=vim
  1119. alias vi=vim
  1120. shell_locales.sh: |
  1121. export LANG=en_US
  1122. export LC_ALL=en_US.UTF-8
  1123. shell_proxies.sh: |
  1124. export FTP_PROXY=ftp://127.0.3.3:2121
  1125. export NO_PROXY='.local'
  1126. Linux with hosts
  1127. Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
  1128. that are not defined in model except defaults for both IPv4 and IPv6 localhost
  1129. and hostname + fqdn.
  1130. It's good to use this option if you want to ensure /etc/hosts is always in a
  1131. clean state however it's not enabled by default for safety.
  1132. .. code-block:: yaml
  1133. linux:
  1134. network:
  1135. purge_hosts: true
  1136. host:
  1137. # No need to define this one if purge_hosts is true
  1138. hostname:
  1139. address: 127.0.1.1
  1140. names:
  1141. - ${linux:network:fqdn}
  1142. - ${linux:network:hostname}
  1143. node1:
  1144. address: 192.168.10.200
  1145. names:
  1146. - node2.domain.com
  1147. - service2.domain.com
  1148. node2:
  1149. address: 192.168.10.201
  1150. names:
  1151. - node2.domain.com
  1152. - service2.domain.com
  1153. Linux with hosts collected from mine
  1154. In this case all dns records defined within infrastrucuture will be passed to
  1155. local hosts records or any DNS server. Only hosts with `grain` parameter to
  1156. true will be propagated to the mine.
  1157. .. code-block:: yaml
  1158. linux:
  1159. network:
  1160. purge_hosts: true
  1161. mine_dns_records: true
  1162. host:
  1163. node1:
  1164. address: 192.168.10.200
  1165. grain: true
  1166. names:
  1167. - node2.domain.com
  1168. - service2.domain.com
  1169. Setup resolv.conf, nameservers, domain and search domains
  1170. .. code-block:: yaml
  1171. linux:
  1172. network:
  1173. resolv:
  1174. dns:
  1175. - 8.8.4.4
  1176. - 8.8.8.8
  1177. domain: my.example.com
  1178. search:
  1179. - my.example.com
  1180. - example.com
  1181. options:
  1182. - ndots: 5
  1183. - timeout: 2
  1184. - attempts: 2
  1185. setting custom TX queue length for tap interfaces
  1186. .. code-block:: yaml
  1187. linux:
  1188. network:
  1189. tap_custom_txqueuelen: 10000
  1190. DPDK OVS interfaces
  1191. **DPDK OVS NIC**
  1192. .. code-block:: yaml
  1193. linux:
  1194. network:
  1195. bridge: openvswitch
  1196. dpdk:
  1197. enabled: true
  1198. driver: uio/vfio
  1199. openvswitch:
  1200. pmd_cpu_mask: "0x6"
  1201. dpdk_socket_mem: "1024,1024"
  1202. dpdk_lcore_mask: "0x400"
  1203. memory_channels: 2
  1204. interface:
  1205. dpkd0:
  1206. name: ${_param:dpdk_nic}
  1207. pci: 0000:06:00.0
  1208. driver: igb_uio/vfio-pci
  1209. enabled: true
  1210. type: dpdk_ovs_port
  1211. n_rxq: 2
  1212. pmd_rxq_affinity: "0:1,1:2"
  1213. bridge: br-prv
  1214. mtu: 9000
  1215. br-prv:
  1216. enabled: true
  1217. type: dpdk_ovs_bridge
  1218. **DPDK OVS Bond**
  1219. .. code-block:: yaml
  1220. linux:
  1221. network:
  1222. bridge: openvswitch
  1223. dpdk:
  1224. enabled: true
  1225. driver: uio/vfio
  1226. openvswitch:
  1227. pmd_cpu_mask: "0x6"
  1228. dpdk_socket_mem: "1024,1024"
  1229. dpdk_lcore_mask: "0x400"
  1230. memory_channels: 2
  1231. interface:
  1232. dpdk_second_nic:
  1233. name: ${_param:primary_second_nic}
  1234. pci: 0000:06:00.0
  1235. driver: igb_uio/vfio-pci
  1236. bond: dpdkbond0
  1237. enabled: true
  1238. type: dpdk_ovs_port
  1239. n_rxq: 2
  1240. pmd_rxq_affinity: "0:1,1:2"
  1241. mtu: 9000
  1242. dpdk_first_nic:
  1243. name: ${_param:primary_first_nic}
  1244. pci: 0000:05:00.0
  1245. driver: igb_uio/vfio-pci
  1246. bond: dpdkbond0
  1247. enabled: true
  1248. type: dpdk_ovs_port
  1249. n_rxq: 2
  1250. pmd_rxq_affinity: "0:1,1:2"
  1251. mtu: 9000
  1252. dpdkbond0:
  1253. enabled: true
  1254. bridge: br-prv
  1255. type: dpdk_ovs_bond
  1256. mode: active-backup
  1257. br-prv:
  1258. enabled: true
  1259. type: dpdk_ovs_bridge
  1260. **DPDK OVS LACP Bond with vlan tag**
  1261. .. code-block:: yaml
  1262. linux:
  1263. network:
  1264. bridge: openvswitch
  1265. dpdk:
  1266. enabled: true
  1267. driver: uio
  1268. openvswitch:
  1269. pmd_cpu_mask: "0x6"
  1270. dpdk_socket_mem: "1024,1024"
  1271. dpdk_lcore_mask: "0x400"
  1272. memory_channels: "2"
  1273. interface:
  1274. eth3:
  1275. enabled: true
  1276. type: eth
  1277. proto: manual
  1278. name: ${_param:tenant_first_nic}
  1279. eth4:
  1280. enabled: true
  1281. type: eth
  1282. proto: manual
  1283. name: ${_param:tenant_second_nic}
  1284. dpdk0:
  1285. name: ${_param:tenant_first_nic}
  1286. pci: "0000:81:00.0"
  1287. driver: igb_uio
  1288. bond: bond1
  1289. enabled: true
  1290. type: dpdk_ovs_port
  1291. n_rxq: 2
  1292. dpdk1:
  1293. name: ${_param:tenant_second_nic}
  1294. pci: "0000:81:00.1"
  1295. driver: igb_uio
  1296. bond: bond1
  1297. enabled: true
  1298. type: dpdk_ovs_port
  1299. n_rxq: 2
  1300. bond1:
  1301. enabled: true
  1302. bridge: br-prv
  1303. type: dpdk_ovs_bond
  1304. mode: balance-slb
  1305. br-prv:
  1306. enabled: true
  1307. type: dpdk_ovs_bridge
  1308. tag: ${_param:tenant_vlan}
  1309. address: ${_param:tenant_address}
  1310. netmask: ${_param:tenant_network_netmask}
  1311. **DPDK OVS bridge for VXLAN**
  1312. If VXLAN is used as tenant segmentation then ip address must be set on br-prv
  1313. .. code-block:: yaml
  1314. linux:
  1315. network:
  1316. ...
  1317. interface:
  1318. br-prv:
  1319. enabled: true
  1320. type: dpdk_ovs_bridge
  1321. address: 192.168.50.0
  1322. netmask: 255.255.255.0
  1323. tag: 101
  1324. mtu: 9000
  1325. **DPDK OVS bridge with Linux network interface**
  1326. .. code-block:: yaml
  1327. linux:
  1328. network:
  1329. ...
  1330. interface:
  1331. eth0:
  1332. type: eth
  1333. ovs_bridge: br-prv
  1334. ...
  1335. br-prv:
  1336. enabled: true
  1337. type: dpdk_ovs_bridge
  1338. ...
  1339. Linux storage
  1340. -------------
  1341. Linux with mounted Samba
  1342. .. code-block:: yaml
  1343. linux:
  1344. storage:
  1345. enabled: true
  1346. mount:
  1347. samba1:
  1348. - enabled: true
  1349. - path: /media/myuser/public/
  1350. - device: //192.168.0.1/storage
  1351. - file_system: cifs
  1352. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  1353. NFS mount
  1354. .. code-block:: yaml
  1355. linux:
  1356. storage:
  1357. enabled: true
  1358. mount:
  1359. nfs_glance:
  1360. enabled: true
  1361. path: /var/lib/glance/images
  1362. device: 172.16.10.110:/var/nfs/glance
  1363. file_system: nfs
  1364. opts: rw,sync
  1365. File swap configuration
  1366. .. code-block:: yaml
  1367. linux:
  1368. storage:
  1369. enabled: true
  1370. swap:
  1371. file:
  1372. enabled: true
  1373. engine: file
  1374. device: /swapfile
  1375. size: 1024
  1376. Partition swap configuration
  1377. .. code-block:: yaml
  1378. linux:
  1379. storage:
  1380. enabled: true
  1381. swap:
  1382. partition:
  1383. enabled: true
  1384. engine: partition
  1385. device: /dev/vg0/swap
  1386. LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
  1387. .. code-block:: yaml
  1388. parameters:
  1389. linux:
  1390. storage:
  1391. mount:
  1392. data:
  1393. enabled: true
  1394. device: /dev/vg1/data
  1395. file_system: ext4
  1396. path: /mnt/data
  1397. lvm:
  1398. vg1:
  1399. enabled: true
  1400. devices:
  1401. - /dev/sdb
  1402. volume:
  1403. data:
  1404. size: 40G
  1405. mount: ${linux:storage:mount:data}
  1406. Create partitions on disk. Specify size in MB. It expects empty
  1407. disk without any existing partitions. (set startsector=1, if you want to start partitions from 2048)
  1408. .. code-block:: yaml
  1409. linux:
  1410. storage:
  1411. disk:
  1412. first_drive:
  1413. startsector: 1
  1414. name: /dev/loop1
  1415. type: gpt
  1416. partitions:
  1417. - size: 200 #size in MB
  1418. type: fat32
  1419. - size: 300 #size in MB
  1420. mkfs: True
  1421. type: xfs
  1422. /dev/vda1:
  1423. partitions:
  1424. - size: 5
  1425. type: ext2
  1426. - size: 10
  1427. type: ext4
  1428. Multipath with Fujitsu Eternus DXL
  1429. .. code-block:: yaml
  1430. parameters:
  1431. linux:
  1432. storage:
  1433. multipath:
  1434. enabled: true
  1435. blacklist_devices:
  1436. - /dev/sda
  1437. - /dev/sdb
  1438. backends:
  1439. - fujitsu_eternus_dxl
  1440. Multipath with Hitachi VSP 1000
  1441. .. code-block:: yaml
  1442. parameters:
  1443. linux:
  1444. storage:
  1445. multipath:
  1446. enabled: true
  1447. blacklist_devices:
  1448. - /dev/sda
  1449. - /dev/sdb
  1450. backends:
  1451. - hitachi_vsp1000
  1452. Multipath with IBM Storwize
  1453. .. code-block:: yaml
  1454. parameters:
  1455. linux:
  1456. storage:
  1457. multipath:
  1458. enabled: true
  1459. blacklist_devices:
  1460. - /dev/sda
  1461. - /dev/sdb
  1462. backends:
  1463. - ibm_storwize
  1464. Multipath with multiple backends
  1465. .. code-block:: yaml
  1466. parameters:
  1467. linux:
  1468. storage:
  1469. multipath:
  1470. enabled: true
  1471. blacklist_devices:
  1472. - /dev/sda
  1473. - /dev/sdb
  1474. - /dev/sdc
  1475. - /dev/sdd
  1476. backends:
  1477. - ibm_storwize
  1478. - fujitsu_eternus_dxl
  1479. - hitachi_vsp1000
  1480. PAM LDAP integration
  1481. .. code-block:: yaml
  1482. parameters:
  1483. linux:
  1484. system:
  1485. auth:
  1486. enabled: true
  1487. ldap:
  1488. enabled: true
  1489. binddn: cn=bind,ou=service_users,dc=example,dc=com
  1490. bindpw: secret
  1491. uri: ldap://127.0.0.1
  1492. base: ou=users,dc=example,dc=com
  1493. ldap_version: 3
  1494. pagesize: 65536
  1495. referrals: off
  1496. filter:
  1497. passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1498. shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1499. group: (&(objectClass=group)(gidNumber=*))
  1500. Disabled multipath (the default setup)
  1501. .. code-block:: yaml
  1502. parameters:
  1503. linux:
  1504. storage:
  1505. multipath:
  1506. enabled: false
  1507. Linux with local loopback device
  1508. .. code-block:: yaml
  1509. linux:
  1510. storage:
  1511. loopback:
  1512. disk1:
  1513. file: /srv/disk1
  1514. size: 50G
  1515. External config generation
  1516. --------------------------
  1517. You are able to use config support metadata between formulas and only generate
  1518. config files for external use, eg. docker, etc.
  1519. .. code-block:: yaml
  1520. parameters:
  1521. linux:
  1522. system:
  1523. config:
  1524. pillar:
  1525. jenkins:
  1526. master:
  1527. home: /srv/volumes/jenkins
  1528. approved_scripts:
  1529. - method java.net.URL openConnection
  1530. credentials:
  1531. - type: username_password
  1532. scope: global
  1533. id: test
  1534. desc: Testing credentials
  1535. username: test
  1536. password: test
  1537. Netconsole Remote Kernel Logging
  1538. --------------------------------
  1539. Netconsole logger could be configured for configfs-enabled kernels
  1540. (`CONFIG_NETCONSOLE_DYNAMIC` should be enabled). Configuration applies both in
  1541. runtime (if network is already configured), and on-boot after interface
  1542. initialization. Notes:
  1543. * receiver could be located only in same L3 domain
  1544. (or you need to configure gateway MAC manually)
  1545. * receiver's MAC is detected only on configuration time
  1546. * using broadcast MAC is not recommended
  1547. .. code-block:: yaml
  1548. parameters:
  1549. linux:
  1550. system:
  1551. netconsole:
  1552. enabled: true
  1553. port: 514 (optional)
  1554. loglevel: debug (optional)
  1555. target:
  1556. 192.168.0.1:
  1557. interface: bond0
  1558. mac: "ff:ff:ff:ff:ff:ff" (optional)
  1559. Usage
  1560. =====
  1561. Set mtu of network interface eth0 to 1400
  1562. .. code-block:: bash
  1563. ip link set dev eth0 mtu 1400
  1564. Read more
  1565. =========
  1566. * https://www.archlinux.org/
  1567. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
  1568. Documentation and Bugs
  1569. ======================
  1570. To learn how to install and update salt-formulas, consult the documentation
  1571. available online at:
  1572. http://salt-formulas.readthedocs.io/
  1573. In the unfortunate event that bugs are discovered, they should be reported to
  1574. the appropriate issue tracker. Use Github issue tracker for specific salt
  1575. formula:
  1576. https://github.com/salt-formulas/salt-formula-linux/issues
  1577. For feature requests, bug reports or blueprints affecting entire ecosystem,
  1578. use Launchpad salt-formulas project:
  1579. https://launchpad.net/salt-formulas
  1580. You can also join salt-formulas-users team and subscribe to mailing list:
  1581. https://launchpad.net/~salt-formulas-users
  1582. Developers wishing to work on the salt-formulas projects should always base
  1583. their work on master branch and submit pull request against specific formula.
  1584. https://github.com/salt-formulas/salt-formula-linux
  1585. Any questions or feedback is always welcome so feel free to join our IRC
  1586. channel:
  1587. #salt-formulas @ irc.freenode.net