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

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