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

README.rst 47KB

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