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

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