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

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
9 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564
  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. unique: false
  43. jsmith:
  44. name: 'jsmith'
  45. enabled: true
  46. full_name: 'With clear password'
  47. home: '/home/jsmith'
  48. hash_password: true
  49. password: "userpassword"
  50. mark:
  51. name: 'mark'
  52. enabled: true
  53. full_name: "unchange password'
  54. home: '/home/mark'
  55. password: false
  56. elizabeth:
  57. name: 'elizabeth'
  58. enabled: true
  59. full_name: 'With hased password'
  60. home: '/home/elizabeth'
  61. password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10"
  62. Configure password expiration parameters
  63. ----------------------------------------
  64. The following login.defs parameters can be overridden per-user:
  65. * PASS_MAX_DAYS
  66. * PASS_MIN_DAYS
  67. * PASS_WARN_DAYS
  68. * INACTIVE
  69. .. code-block:: yaml
  70. linux:
  71. system:
  72. ...
  73. user:
  74. jdoe:
  75. name: 'jdoe'
  76. enabled: true
  77. ...
  78. maxdays: <PASS_MAX_DAYS>
  79. mindays: <PASS_MIN_DAYS>
  80. warndays: <PASS_WARN_DAYS>
  81. inactdays: <INACTIVE>
  82. Configure sudo for users and groups under ``/etc/sudoers.d/``.
  83. This ways ``linux.system.sudo`` pillar map to actual sudo attributes:
  84. .. code-block:: jinja
  85. # simplified template:
  86. Cmds_Alias {{ alias }}={{ commands }}
  87. {{ user }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
  88. %{{ group }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
  89. # when rendered:
  90. saltuser1 ALL=(ALL) NOPASSWD: ALL
  91. .. code-block:: yaml
  92. linux:
  93. system:
  94. sudo:
  95. enabled: true
  96. aliases:
  97. host:
  98. LOCAL:
  99. - localhost
  100. PRODUCTION:
  101. - db1
  102. - db2
  103. runas:
  104. DBA:
  105. - postgres
  106. - mysql
  107. SALT:
  108. - root
  109. command:
  110. # Note: This is not 100% safe when ALL keyword is used, user still may modify configs and hide his actions.
  111. # Best practice is to specify full list of commands user is allowed to run.
  112. SUPPORT_RESTRICTED:
  113. - /bin/vi /etc/sudoers*
  114. - /bin/vim /etc/sudoers*
  115. - /bin/nano /etc/sudoers*
  116. - /bin/emacs /etc/sudoers*
  117. - /bin/su - root
  118. - /bin/su -
  119. - /bin/su
  120. - /usr/sbin/visudo
  121. SUPPORT_SHELLS:
  122. - /bin/sh
  123. - /bin/ksh
  124. - /bin/bash
  125. - /bin/rbash
  126. - /bin/dash
  127. - /bin/zsh
  128. - /bin/csh
  129. - /bin/fish
  130. - /bin/tcsh
  131. - /usr/bin/login
  132. - /usr/bin/su
  133. - /usr/su
  134. ALL_SALT_SAFE:
  135. - /usr/bin/salt state*
  136. - /usr/bin/salt service*
  137. - /usr/bin/salt pillar*
  138. - /usr/bin/salt grains*
  139. - /usr/bin/salt saltutil*
  140. - /usr/bin/salt-call state*
  141. - /usr/bin/salt-call service*
  142. - /usr/bin/salt-call pillar*
  143. - /usr/bin/salt-call grains*
  144. - /usr/bin/salt-call saltutil*
  145. SALT_TRUSTED:
  146. - /usr/bin/salt*
  147. users:
  148. # saltuser1 with default values: saltuser1 ALL=(ALL) NOPASSWD: ALL
  149. saltuser1: {}
  150. saltuser2:
  151. hosts:
  152. - LOCAL
  153. # User Alias DBA
  154. DBA:
  155. hosts:
  156. - ALL
  157. commands:
  158. - ALL_SALT_SAFE
  159. groups:
  160. db-ops:
  161. hosts:
  162. - ALL
  163. - '!PRODUCTION'
  164. runas:
  165. - DBA
  166. commands:
  167. - /bin/cat *
  168. - /bin/less *
  169. - /bin/ls *
  170. salt-ops:
  171. hosts:
  172. - 'ALL'
  173. runas:
  174. - SALT
  175. commands:
  176. - SUPPORT_SHELLS
  177. salt-ops-2nd:
  178. name: salt-ops
  179. nopasswd: false
  180. setenv: true # Enable sudo -E option
  181. runas:
  182. - DBA
  183. commands:
  184. - ALL
  185. - '!SUPPORT_SHELLS'
  186. - '!SUPPORT_RESTRICTED'
  187. Linux with package, latest version:
  188. .. code-block:: yaml
  189. linux:
  190. system:
  191. ...
  192. package:
  193. package-name:
  194. version: latest
  195. Linux with package from certail repo, version with no upgrades:
  196. .. code-block:: yaml
  197. linux:
  198. system:
  199. ...
  200. package:
  201. package-name:
  202. version: 2132.323
  203. repo: 'custom-repo'
  204. hold: true
  205. Linux with package from certail repo, version with no GPG
  206. verification:
  207. .. code-block:: yaml
  208. linux:
  209. system:
  210. ...
  211. package:
  212. package-name:
  213. version: 2132.323
  214. repo: 'custom-repo'
  215. verify: false
  216. Linux with autoupdates (automatically install security package
  217. updates):
  218. .. code-block:: yaml
  219. linux:
  220. system:
  221. ...
  222. autoupdates:
  223. enabled: true
  224. mail: root@localhost
  225. mail_only_on_error: true
  226. remove_unused_dependencies: false
  227. automatic_reboot: true
  228. automatic_reboot_time: "02:00"
  229. Managing cron tasks
  230. -------------------
  231. There are two data structures that are related to managing cron itself and
  232. cron tasks:
  233. .. code-block:: yaml
  234. linux:
  235. system:
  236. cron:
  237. and
  238. .. code-block:: yaml
  239. linux:
  240. system:
  241. job:
  242. `linux:system:cron` manages cron packages, services, and '/etc/cron.allow' file.
  243. 'deny' files are managed the only way - we're ensuring they are absent, that's
  244. a requirement from CIS 5.1.8
  245. 'cron' pillar structure is the following:
  246. .. code-block:: yaml
  247. linux:
  248. system:
  249. cron:
  250. enabled: true
  251. pkgs: [ <cron packages> ]
  252. services: [ <cron services> ]
  253. user:
  254. <username>:
  255. enabled: true
  256. To add user to '/etc/cron.allow' use 'enabled' key as shown above.
  257. '/etc/cron.deny' is not managed as CIS 5.1.8 requires it was removed.
  258. A user would be ignored if any of the following is true:
  259. * user is disabled in `linux:system:user:<username>`
  260. * user is disabled in `linux:system:cron:user:<username>`
  261. `linux:system:job` manages individual cron tasks.
  262. By default, it will use name as an identifier, unless identifier key is
  263. explicitly set or False (then it will use Salt's default behavior which is
  264. identifier same as command resulting in not being able to change it):
  265. .. code-block:: yaml
  266. linux:
  267. system:
  268. ...
  269. job:
  270. cmd1:
  271. command: '/cmd/to/run'
  272. identifier: cmd1
  273. enabled: true
  274. user: 'root'
  275. hour: 2
  276. minute: 0
  277. Managing 'at' tasks
  278. -------------------
  279. Pillar for managing `at` tasks is similar to one for `cron` tasks:
  280. .. code-block:: yaml
  281. linux:
  282. system:
  283. at:
  284. enabled: true
  285. pkgs: [ <at packages> ]
  286. services: [ <at services> ]
  287. user:
  288. <username>:
  289. enabled: true
  290. To add a user to '/etc/at.allow' use 'enabled' key as shown above.
  291. '/etc/at.deny' is not managed as CIS 5.1.8 requires it was removed.
  292. A user will be ignored if any of the following is true:
  293. * user is disabled in `linux:system:user:<username>`
  294. * user is disabled in `linux:system:at:user:<username>`
  295. Linux security limits (limit sensu user memory usage to max 1GB):
  296. .. code-block:: yaml
  297. linux:
  298. system:
  299. ...
  300. limit:
  301. sensu:
  302. enabled: true
  303. domain: sensu
  304. limits:
  305. - type: hard
  306. item: as
  307. value: 1000000
  308. Enable autologin on ``tty1`` (may work only for Ubuntu 14.04):
  309. .. code-block:: yaml
  310. linux:
  311. system:
  312. console:
  313. tty1:
  314. autologin: root
  315. # Enable serial console
  316. ttyS0:
  317. autologin: root
  318. rate: 115200
  319. term: xterm
  320. To disable set autologin to ``false``.
  321. Set ``policy-rc.d`` on Debian-based systems. Action can be any available
  322. command in ``while true`` loop and ``case`` context.
  323. Following will disallow dpkg to stop/start services for the Cassandra
  324. package automatically:
  325. .. code-block:: yaml
  326. linux:
  327. system:
  328. policyrcd:
  329. - package: cassandra
  330. action: exit 101
  331. - package: '*'
  332. action: switch
  333. Set system locales:
  334. .. code-block:: yaml
  335. linux:
  336. system:
  337. locale:
  338. en_US.UTF-8:
  339. default: true
  340. "cs_CZ.UTF-8 UTF-8":
  341. enabled: true
  342. Systemd settings:
  343. .. code-block:: yaml
  344. linux:
  345. system:
  346. ...
  347. systemd:
  348. system:
  349. Manager:
  350. DefaultLimitNOFILE: 307200
  351. DefaultLimitNPROC: 307200
  352. user:
  353. Manager:
  354. DefaultLimitCPU: 2
  355. DefaultLimitNPROC: 4
  356. Ensure presence of directory:
  357. .. code-block:: yaml
  358. linux:
  359. system:
  360. directory:
  361. /tmp/test:
  362. user: root
  363. group: root
  364. mode: 700
  365. makedirs: true
  366. Ensure presence of file by specifying its source:
  367. .. code-block:: yaml
  368. linux:
  369. system:
  370. file:
  371. /tmp/test.txt:
  372. source: http://example.com/test.txt
  373. user: root #optional
  374. group: root #optional
  375. mode: 700 #optional
  376. dir_mode: 700 #optional
  377. encoding: utf-8 #optional
  378. hash: <<hash>> or <<URI to hash>> #optional
  379. makedirs: true #optional
  380. linux:
  381. system:
  382. file:
  383. test.txt:
  384. name: /tmp/test.txt
  385. source: http://example.com/test.txt
  386. linux:
  387. system:
  388. file:
  389. test2:
  390. name: /tmp/test2.txt
  391. source: http://example.com/test2.jinja
  392. template: jinja
  393. Ensure presence of file by specifying its contents:
  394. .. code-block:: yaml
  395. linux:
  396. system:
  397. file:
  398. /tmp/test.txt:
  399. contents: |
  400. line1
  401. line2
  402. linux:
  403. system:
  404. file:
  405. /tmp/test.txt:
  406. contents_pillar: linux:network:hostname
  407. linux:
  408. system:
  409. file:
  410. /tmp/test.txt:
  411. contents_grains: motd
  412. Ensure presence of file to be serialized through one of the
  413. serializer modules (see:
  414. https://docs.saltstack.com/en/latest/ref/serializers/all/index.html):
  415. .. code-block:: yaml
  416. linux:
  417. system:
  418. file:
  419. /tmp/test.json:
  420. serialize: json
  421. contents:
  422. foo: 1
  423. bar: 'bar'
  424. Kernel
  425. ~~~~~~
  426. Install always up to date LTS kernel and headers from Ubuntu Trusty:
  427. .. code-block:: yaml
  428. linux:
  429. system:
  430. kernel:
  431. type: generic
  432. lts: trusty
  433. headers: true
  434. Load kernel modules and add them to ``/etc/modules``:
  435. .. code-block:: yaml
  436. linux:
  437. system:
  438. kernel:
  439. modules:
  440. - nf_conntrack
  441. - tp_smapi
  442. - 8021q
  443. Configure or blacklist kernel modules with additional options to
  444. ``/etc/modprobe.d`` following example will add
  445. ``/etc/modprobe.d/nf_conntrack.conf`` file with line
  446. ``options nf_conntrack hashsize=262144``:
  447. 'option' can be a mapping (with 'enabled' and 'value' keys) or a scalar.
  448. Example for 'scalar' option value:
  449. .. code-block:: yaml
  450. linux:
  451. system:
  452. kernel:
  453. module:
  454. nf_conntrack:
  455. option:
  456. hashsize: 262144
  457. Example for 'mapping' option value:
  458. .. code-block:: yaml
  459. linux:
  460. system:
  461. kernel:
  462. module:
  463. nf_conntrack:
  464. option:
  465. hashsize:
  466. enabled: true
  467. value: 262144
  468. NOTE: 'enabled' key is optional and is True by default.
  469. Blacklist a module:
  470. .. code-block:: yaml
  471. linux:
  472. system:
  473. kernel:
  474. module:
  475. nf_conntrack:
  476. blacklist: true
  477. A module can have a number of aliases, wildcards are allowed.
  478. Define an alias for a module:
  479. .. code-block:: yaml
  480. linux:
  481. system:
  482. kernel:
  483. module:
  484. nf_conntrack:
  485. alias:
  486. nfct:
  487. enabled: true
  488. "nf_conn*":
  489. enabled: true
  490. NOTE: 'enabled' key is mandatory as there are no other keys exist.
  491. Execute custom command instead of 'insmod' when inserting a module:
  492. .. code-block:: yaml
  493. linux:
  494. system:
  495. kernel:
  496. module:
  497. nf_conntrack:
  498. install:
  499. enabled: true
  500. command: /bin/true
  501. NOTE: 'enabled' key is optional and is True by default.
  502. Execute custom command instead of 'rmmod' when removing a module:
  503. .. code-block:: yaml
  504. linux:
  505. system:
  506. kernel:
  507. module:
  508. nf_conntrack:
  509. remove:
  510. enabled: true
  511. command: /bin/true
  512. NOTE: 'enabled' key is optional and is True by default.
  513. Define module dependencies:
  514. .. code-block:: yaml
  515. linux:
  516. system:
  517. kernel:
  518. module:
  519. nf_conntrack:
  520. softdep:
  521. pre:
  522. 1:
  523. enabled: true
  524. value: a
  525. 2:
  526. enabled: true
  527. value: b
  528. 3:
  529. enabled: true
  530. value: c
  531. post:
  532. 1:
  533. enabled: true
  534. value: x
  535. 2:
  536. enabled: true
  537. value: y
  538. 3:
  539. enabled: true
  540. value: z
  541. NOTE: 'enabled' key is optional and is True by default.
  542. Install specific kernel version and ensure all other kernel packages are
  543. not present. Also install extra modules and headers for this kernel:
  544. .. code-block:: yaml
  545. linux:
  546. system:
  547. kernel:
  548. type: generic
  549. extra: true
  550. headers: true
  551. version: 4.2.0-22
  552. Systcl kernel parameters:
  553. .. code-block:: yaml
  554. linux:
  555. system:
  556. kernel:
  557. sysctl:
  558. net.ipv4.tcp_keepalive_intvl: 3
  559. net.ipv4.tcp_keepalive_time: 30
  560. net.ipv4.tcp_keepalive_probes: 8
  561. Configure kernel boot options:
  562. .. code-block:: yaml
  563. linux:
  564. system:
  565. kernel:
  566. boot_options:
  567. - elevator=deadline
  568. - spectre_v2=off
  569. - nopti
  570. CPU
  571. ~~~
  572. Enable cpufreq governor for every cpu:
  573. .. code-block:: yaml
  574. linux:
  575. system:
  576. cpu:
  577. governor: performance
  578. CGROUPS
  579. ~~~~~~~
  580. Setup linux cgroups:
  581. .. code-block:: yaml
  582. linux:
  583. system:
  584. cgroup:
  585. enabled: true
  586. group:
  587. ceph_group_1:
  588. controller:
  589. cpu:
  590. shares:
  591. value: 250
  592. cpuacct:
  593. usage:
  594. value: 0
  595. cpuset:
  596. cpus:
  597. value: 1,2,3
  598. memory:
  599. limit_in_bytes:
  600. value: 2G
  601. memsw.limit_in_bytes:
  602. value: 3G
  603. mapping:
  604. subjects:
  605. - '@ceph'
  606. generic_group_1:
  607. controller:
  608. cpu:
  609. shares:
  610. value: 250
  611. cpuacct:
  612. usage:
  613. value: 0
  614. mapping:
  615. subjects:
  616. - '*:firefox'
  617. - 'student:cp'
  618. Shared libraries
  619. ~~~~~~~~~~~~~~~~
  620. Set additional shared library to Linux system library path:
  621. .. code-block:: yaml
  622. linux:
  623. system:
  624. ld:
  625. library:
  626. java:
  627. - /usr/lib/jvm/jre-openjdk/lib/amd64/server
  628. - /opt/java/jre/lib/amd64/server
  629. Certificates
  630. ~~~~~~~~~~~~
  631. Add certificate authority into system trusted CA bundle:
  632. .. code-block:: yaml
  633. linux:
  634. system:
  635. ca_certificates:
  636. mycert: |
  637. -----BEGIN CERTIFICATE-----
  638. MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
  639. A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
  640. cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
  641. MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
  642. BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
  643. YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
  644. ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
  645. BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
  646. I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
  647. CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
  648. lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
  649. AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
  650. -----END CERTIFICATE-----
  651. Sysfs
  652. ~~~~~
  653. Install sysfsutils and set sysfs attributes:
  654. .. code-block:: yaml
  655. linux:
  656. system:
  657. sysfs:
  658. scheduler:
  659. block/sda/queue/scheduler: deadline
  660. power:
  661. mode:
  662. power/state: 0660
  663. owner:
  664. power/state: "root:power"
  665. devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
  666. Optional: You can also use list that will ensure order of items.
  667. .. code-block:: yaml
  668. linux:
  669. system:
  670. sysfs:
  671. scheduler:
  672. block/sda/queue/scheduler: deadline
  673. power:
  674. - mode:
  675. power/state: 0660
  676. - owner:
  677. power/state: "root:power"
  678. - devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
  679. Sysfs definition with disabled automatic write. Attributes are saved
  680. to configuration, but are not applied during the run.
  681. Thay will be applied automatically after the reboot.
  682. .. code-block:: yaml
  683. linux:
  684. system:
  685. sysfs:
  686. enable_apply: false
  687. scheduler:
  688. block/sda/queue/scheduler: deadline
  689. .. note:: The `enable_apply` parameter defaults to `True` if not defined.
  690. Huge Pages
  691. ~~~~~~~~~~~~
  692. Huge Pages give a performance boost to applications that intensively deal
  693. with memory allocation/deallocation by decreasing memory fragmentation:
  694. .. code-block:: yaml
  695. linux:
  696. system:
  697. kernel:
  698. hugepages:
  699. small:
  700. size: 2M
  701. count: 107520
  702. mount_point: /mnt/hugepages_2MB
  703. mount: false/true # default is true (mount immediately) / false (just save in the fstab)
  704. large:
  705. default: true # default automatically mounted
  706. size: 1G
  707. count: 210
  708. mount_point: /mnt/hugepages_1GB
  709. .. note:: Not recommended to use both pagesizes concurrently.
  710. Intel SR-IOV
  711. ~~~~~~~~~~~~
  712. PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV)
  713. specification defines a standardized mechanism to virtualize
  714. PCIe devices. The mechanism can virtualize a single PCIe
  715. Ethernet controller to appear as multiple PCIe devices:
  716. .. code-block:: yaml
  717. linux:
  718. system:
  719. kernel:
  720. sriov: True
  721. unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
  722. rc:
  723. local: |
  724. #!/bin/sh -e
  725. # Enable 7 VF on eth1
  726. echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
  727. exit 0
  728. Isolate CPU options
  729. ~~~~~~~~~~~~~~~~~~~
  730. Remove the specified CPUs, as defined by the cpu_number values, from
  731. the general kernel SMP balancing and scheduler algroithms. The only
  732. way to move a process onto or off an *isolated* CPU is via the CPU
  733. affinity syscalls. ``cpu_number begins`` at ``0``, so the
  734. maximum value is ``1`` less than the number of CPUs on the system.:
  735. .. code-block:: yaml
  736. linux:
  737. system:
  738. kernel:
  739. isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
  740. Repositories
  741. ~~~~~~~~~~~~
  742. RedHat-based Linux with additional OpenStack repo:
  743. .. code-block:: yaml
  744. linux:
  745. system:
  746. ...
  747. repo:
  748. rdo-icehouse:
  749. enabled: true
  750. source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
  751. pgpcheck: 0
  752. Ensure system repository to use czech Debian mirror (``default: true``)
  753. Also pin it's packages with priority ``900``:
  754. .. code-block:: yaml
  755. linux:
  756. system:
  757. repo:
  758. debian:
  759. default: true
  760. source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
  761. # Import signing key from URL if needed
  762. key_url: "http://dummy.com/public.gpg"
  763. pin:
  764. - pin: 'origin "ftp.cz.debian.org"'
  765. priority: 900
  766. package: '*'
  767. If you need to add multiple pin rules for one repo, please use new,ordered definition format
  768. ('pinning' definition will be in priotity to use):
  769. .. code-block:: yaml
  770. linux:
  771. system:
  772. repo:
  773. mcp_saltstack:
  774. source: "deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/ xenial main"
  775. architectures: amd64
  776. clean_file: true
  777. pinning:
  778. 10:
  779. enabled: true
  780. pin: 'release o=SaltStack'
  781. priority: 50
  782. package: 'libsodium18'
  783. 20:
  784. enabled: true
  785. pin: 'release o=SaltStack'
  786. priority: 1100
  787. package: '*'
  788. .. note:: For old Ubuntu releases (<xenial)
  789. extra packages for apt transport, like ``apt-transport-https``
  790. may be required to be installed manually.
  791. (Chicken-eggs issue: we need to install packages to
  792. reach repo from where they should be installed)
  793. Otherwise, you still can try 'fortune' and install prereq.packages before
  794. any repo configuration, using list of requires in map.jinja.
  795. Disabling any prerequisite packages installation:
  796. You can simply drop any package pre-installation (before system.linux.repo
  797. will be processed) via cluster lvl:
  798. .. code-block:: yaml
  799. linux:
  800. system:
  801. pkgs: ~
  802. Package manager proxy global setup:
  803. .. code-block:: yaml
  804. linux:
  805. system:
  806. ...
  807. repo:
  808. apt-mk:
  809. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  810. ...
  811. proxy:
  812. pkg:
  813. enabled: true
  814. ftp: ftp://ftp-proxy-for-apt.host.local:2121
  815. ...
  816. # NOTE: Global defaults for any other componet that configure proxy on the system.
  817. # If your environment has just one simple proxy, set it on linux:system:proxy.
  818. #
  819. # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
  820. # as for https and http
  821. ftp: ftp://proxy.host.local:2121
  822. http: http://proxy.host.local:3142
  823. https: https://proxy.host.local:3143
  824. Package manager proxy setup per repository:
  825. .. code-block:: yaml
  826. linux:
  827. system:
  828. ...
  829. repo:
  830. debian:
  831. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  832. ...
  833. apt-mk:
  834. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  835. # per repository proxy
  836. proxy:
  837. enabled: true
  838. http: http://maas-01:8080
  839. https: http://maas-01:8080
  840. ...
  841. proxy:
  842. # package manager fallback defaults
  843. # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
  844. pkg:
  845. enabled: true
  846. ftp: ftp://proxy.host.local:2121
  847. #http: http://proxy.host.local:3142
  848. #https: https://proxy.host.local:3143
  849. ...
  850. # global system fallback system defaults
  851. ftp: ftp://proxy.host.local:2121
  852. http: http://proxy.host.local:3142
  853. https: https://proxy.host.local:3143
  854. Remove all repositories:
  855. .. code-block:: yaml
  856. linux:
  857. system:
  858. purge_repos: true
  859. Refresh repositories metada, after configuration:
  860. .. code-block:: yaml
  861. linux:
  862. system:
  863. refresh_repos_meta: true
  864. Setup custom apt config options:
  865. .. code-block:: yaml
  866. linux:
  867. system:
  868. apt:
  869. config:
  870. compression-workaround:
  871. "Acquire::CompressionTypes::Order": "gz"
  872. docker-clean:
  873. "DPkg::Post-Invoke":
  874. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  875. "APT::Update::Post-Invoke":
  876. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  877. RC
  878. ~~
  879. rc.local example
  880. .. code-block:: yaml
  881. linux:
  882. system:
  883. rc:
  884. local: |
  885. #!/bin/sh -e
  886. #
  887. # rc.local
  888. #
  889. # This script is executed at the end of each multiuser runlevel.
  890. # Make sure that the script will "exit 0" on success or any other
  891. # value on error.
  892. #
  893. # In order to enable or disable this script just change the execution
  894. # bits.
  895. #
  896. # By default this script does nothing.
  897. exit 0
  898. Prompt
  899. ~~~~~~
  900. Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``.
  901. Every user can have different prompt:
  902. .. code-block:: yaml
  903. linux:
  904. system:
  905. prompt:
  906. 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\\]
  907. default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
  908. On Debian systems, to set prompt system-wide, it's necessary to
  909. remove setting PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc``,
  910. which comes from ``/etc/skel/.bashrc``. This formula will do
  911. this automatically, but will not touch existing user's
  912. ``~/.bashrc`` files except root.
  913. Bash
  914. ~~~~
  915. Fix bash configuration to preserve history across sessions
  916. like ZSH does by default:
  917. .. code-block:: yaml
  918. linux:
  919. system:
  920. bash:
  921. preserve_history: true
  922. Login banner message
  923. ~~~~~~~~~~~~~~~~~~~~
  924. ``/etc/issue`` is a text file which contains a message or system
  925. identification to be printed before the login prompt. It may contain
  926. various @char and \char sequences, if supported by the getty-type
  927. program employed on the system.
  928. Setting logon banner message is easy:
  929. .. code-block:: yaml
  930. liunx:
  931. system:
  932. banner:
  933. enabled: true
  934. contents: |
  935. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  936. You must have explicit, authorized permission to access or configure this
  937. device. Unauthorized attempts and actions to access or use this system may
  938. result in civil and/or criminal penalties.
  939. All activities performed on this system are logged and monitored.
  940. Message of the day
  941. ~~~~~~~~~~~~~~~~~~
  942. ``pam_motd`` from package ``libpam-modules`` is used for dynamic
  943. messages of the day. Setting custom ``motd`` will clean up existing ones.
  944. Setting static ``motd`` will replace existing ``/etc/motd`` and remove
  945. scripts from ``/etc/update-motd.d``.
  946. Setting static ``motd``:
  947. .. code-block:: yaml
  948. linux:
  949. system:
  950. motd: |
  951. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  952. You must have explicit, authorized permission to access or configure this
  953. device. Unauthorized attempts and actions to access or use this system may
  954. result in civil and/or criminal penalties.
  955. All activities performed on this system are logged and monitored.
  956. Setting dynamic ``motd``:
  957. .. code-block:: yaml
  958. linux:
  959. system:
  960. motd:
  961. - release: |
  962. #!/bin/sh
  963. [ -r /etc/lsb-release ] && . /etc/lsb-release
  964. if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
  965. # Fall back to using the very slow lsb_release utility
  966. DISTRIB_DESCRIPTION=$(lsb_release -s -d)
  967. fi
  968. printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
  969. - warning: |
  970. #!/bin/sh
  971. printf "This is [company name] network.\n"
  972. printf "Unauthorized access strictly prohibited.\n"
  973. Services
  974. ~~~~~~~~
  975. Stop and disable the ``linux`` service:
  976. .. code-block:: yaml
  977. linux:
  978. system:
  979. service:
  980. apt-daily.timer:
  981. status: dead
  982. Possible statuses are ``dead`` (disable service by default), ``running``
  983. (enable service by default), ``enabled``, ``disabled``:
  984. Linux with the ``atop`` service:
  985. .. code-block:: yaml
  986. linux:
  987. system:
  988. atop:
  989. enabled: true
  990. interval: 20
  991. logpath: "/var/log/atop"
  992. outfile: "/var/log/atop/daily.log"
  993. Linux with the ``mcelog`` service:
  994. .. code-block:: yaml
  995. linux:
  996. system:
  997. mcelog:
  998. enabled: true
  999. logging:
  1000. syslog: true
  1001. syslog_error: true
  1002. RHEL / CentOS
  1003. ^^^^^^^^^^^^^
  1004. Currently, ``update-motd`` is not available
  1005. for RHEL. So there is no native support for dynamic ``motd``.
  1006. You can still set a static one, with a different pillar structure:
  1007. .. code-block:: yaml
  1008. linux:
  1009. system:
  1010. motd: |
  1011. This is [company name] network.
  1012. Unauthorized access strictly prohibited.
  1013. Haveged
  1014. ~~~~~~~
  1015. If you are running headless server and are low on entropy,
  1016. you may set up Haveged:
  1017. .. code-block:: yaml
  1018. linux:
  1019. system:
  1020. haveged:
  1021. enabled: true
  1022. Linux network
  1023. -------------
  1024. Linux with network manager:
  1025. .. code-block:: yaml
  1026. linux:
  1027. network:
  1028. enabled: true
  1029. network_manager: true
  1030. Execute linux.network.interface state without ifupdown activity:
  1031. .. code-block:: bash
  1032. salt-call linux.network.interface pillar='{"linux":{"network":{"noifupdown":True}}}'
  1033. Linux with default static network interfaces, default gateway
  1034. interface and DNS servers:
  1035. .. code-block:: yaml
  1036. linux:
  1037. network:
  1038. enabled: true
  1039. interface:
  1040. eth0:
  1041. enabled: true
  1042. type: eth
  1043. address: 192.168.0.102
  1044. netmask: 255.255.255.0
  1045. gateway: 192.168.0.1
  1046. name_servers:
  1047. - 8.8.8.8
  1048. - 8.8.4.4
  1049. mtu: 1500
  1050. Linux with bonded interfaces and disabled ``NetworkManager``:
  1051. .. code-block:: yaml
  1052. linux:
  1053. network:
  1054. enabled: true
  1055. interface:
  1056. eth0:
  1057. type: eth
  1058. ...
  1059. eth1:
  1060. type: eth
  1061. ...
  1062. bond0:
  1063. enabled: true
  1064. type: bond
  1065. address: 192.168.0.102
  1066. netmask: 255.255.255.0
  1067. mtu: 1500
  1068. use_in:
  1069. - interface: ${linux:interface:eth0}
  1070. - interface: ${linux:interface:eth0}
  1071. network_manager:
  1072. disable: true
  1073. Linux with VLAN ``interface_params``:
  1074. .. code-block:: yaml
  1075. linux:
  1076. network:
  1077. enabled: true
  1078. interface:
  1079. vlan69:
  1080. type: vlan
  1081. use_interfaces:
  1082. - interface: ${linux:interface:bond0}
  1083. Linux with wireless interface parameters:
  1084. .. code-block:: yaml
  1085. linux:
  1086. network:
  1087. enabled: true
  1088. gateway: 10.0.0.1
  1089. default_interface: eth0
  1090. interface:
  1091. wlan0:
  1092. type: eth
  1093. wireless:
  1094. essid: example
  1095. key: example_key
  1096. security: wpa
  1097. priority: 1
  1098. Linux networks with routes defined:
  1099. .. code-block:: yaml
  1100. linux:
  1101. network:
  1102. enabled: true
  1103. gateway: 10.0.0.1
  1104. default_interface: eth0
  1105. interface:
  1106. eth0:
  1107. type: eth
  1108. route:
  1109. default:
  1110. address: 192.168.0.123
  1111. netmask: 255.255.255.0
  1112. gateway: 192.168.0.1
  1113. Native Linux Bridges:
  1114. .. code-block:: yaml
  1115. linux:
  1116. network:
  1117. interface:
  1118. eth1:
  1119. enabled: true
  1120. type: eth
  1121. proto: manual
  1122. up_cmds:
  1123. - ip address add 0/0 dev $IFACE
  1124. - ip link set $IFACE up
  1125. down_cmds:
  1126. - ip link set $IFACE down
  1127. br-ex:
  1128. enabled: true
  1129. type: bridge
  1130. address: ${linux:network:host:public_local:address}
  1131. netmask: 255.255.255.0
  1132. use_interfaces:
  1133. - eth1
  1134. Open vSwitch Bridges:
  1135. .. code-block:: yaml
  1136. linux:
  1137. network:
  1138. bridge: openvswitch
  1139. interface:
  1140. eth1:
  1141. enabled: true
  1142. type: eth
  1143. proto: manual
  1144. up_cmds:
  1145. - ip address add 0/0 dev $IFACE
  1146. - ip link set $IFACE up
  1147. down_cmds:
  1148. - ip link set $IFACE down
  1149. br-ex:
  1150. enabled: true
  1151. type: bridge
  1152. address: ${linux:network:host:public_local:address}
  1153. netmask: 255.255.255.0
  1154. use_interfaces:
  1155. - eth1
  1156. br-prv:
  1157. enabled: true
  1158. type: ovs_bridge
  1159. mtu: 65000
  1160. br-ens7:
  1161. enabled: true
  1162. name: br-ens7
  1163. type: ovs_bridge
  1164. proto: manual
  1165. mtu: 9000
  1166. use_interfaces:
  1167. - ens7
  1168. patch-br-ens7-br-prv:
  1169. enabled: true
  1170. name: ens7-prv
  1171. ovs_type: ovs_port
  1172. type: ovs_port
  1173. bridge: br-ens7
  1174. port_type: patch
  1175. peer: prv-ens7
  1176. tag: 109 # [] to unset a tag
  1177. mtu: 65000
  1178. patch-br-prv-br-ens7:
  1179. enabled: true
  1180. name: prv-ens7
  1181. bridge: br-prv
  1182. ovs_type: ovs_port
  1183. type: ovs_port
  1184. port_type: patch
  1185. peer: ens7-prv
  1186. tag: 109
  1187. mtu: 65000
  1188. ens7:
  1189. enabled: true
  1190. name: ens7
  1191. proto: manual
  1192. ovs_port_type: OVSPort
  1193. type: ovs_port
  1194. ovs_bridge: br-ens7
  1195. bridge: br-ens7
  1196. Debian manual proto interfaces
  1197. When you are changing interface proto from static in up state
  1198. to manual, you may need to flush ip addresses. For example,
  1199. if you want to use the interface and the ip on the bridge.
  1200. This can be done by setting the ``ipflush_onchange`` to true.
  1201. .. code-block:: yaml
  1202. linux:
  1203. network:
  1204. interface:
  1205. eth1:
  1206. enabled: true
  1207. type: eth
  1208. proto: manual
  1209. mtu: 9100
  1210. ipflush_onchange: true
  1211. Debian static proto interfaces
  1212. When you are changing interface proto from dhcp in up state to
  1213. static, you may need to flush ip addresses and restart interface
  1214. to assign ip address from a managed file. For example, if you wantto
  1215. use the interface and the ip on the bridge. This can be done by
  1216. setting the ``ipflush_onchange`` with combination ``restart_on_ipflush``
  1217. param set to true.
  1218. .. code-block:: yaml
  1219. linux:
  1220. network:
  1221. interface:
  1222. eth1:
  1223. enabled: true
  1224. type: eth
  1225. proto: static
  1226. address: 10.1.0.22
  1227. netmask: 255.255.255.0
  1228. ipflush_onchange: true
  1229. restart_on_ipflush: true
  1230. Concatinating and removing interface files
  1231. Debian based distributions have ``/etc/network/interfaces.d/``
  1232. directory, where you can store configuration of network
  1233. interfaces in separate files. You can concatinate the files
  1234. to the defined destination when needed, this operation removes
  1235. the file from the ``/etc/network/interfaces.d/``. If you just need
  1236. to remove iface files, you can use the ``remove_iface_files`` key.
  1237. .. code-block:: yaml
  1238. linux:
  1239. network:
  1240. concat_iface_files:
  1241. - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
  1242. dst: '/etc/network/interfaces'
  1243. remove_iface_files:
  1244. - '/etc/network/interfaces.d/90-custom.cfg'
  1245. Configure DHCP client
  1246. None of the keys is mandatory, include only those you really need.
  1247. For full list of available options under send, supersede, prepend,
  1248. append refer to dhcp-options(5).
  1249. .. code-block:: yaml
  1250. linux:
  1251. network:
  1252. dhclient:
  1253. enabled: true
  1254. backoff_cutoff: 15
  1255. initial_interval: 10
  1256. reboot: 10
  1257. retry: 60
  1258. select_timeout: 0
  1259. timeout: 120
  1260. send:
  1261. - option: host-name
  1262. declaration: "= gethostname()"
  1263. supersede:
  1264. - option: host-name
  1265. declaration: "spaceship"
  1266. - option: domain-name
  1267. declaration: "domain.home"
  1268. #- option: arp-cache-timeout
  1269. # declaration: 20
  1270. prepend:
  1271. - option: domain-name-servers
  1272. declaration:
  1273. - 8.8.8.8
  1274. - 8.8.4.4
  1275. - option: domain-search
  1276. declaration:
  1277. - example.com
  1278. - eng.example.com
  1279. #append:
  1280. #- option: domain-name-servers
  1281. # declaration: 127.0.0.1
  1282. # ip or subnet to reject dhcp offer from
  1283. reject:
  1284. - 192.33.137.209
  1285. - 10.0.2.0/24
  1286. request:
  1287. - subnet-mask
  1288. - broadcast-address
  1289. - time-offset
  1290. - routers
  1291. - domain-name
  1292. - domain-name-servers
  1293. - domain-search
  1294. - host-name
  1295. - dhcp6.name-servers
  1296. - dhcp6.domain-search
  1297. - dhcp6.fqdn
  1298. - dhcp6.sntp-servers
  1299. - netbios-name-servers
  1300. - netbios-scope
  1301. - interface-mtu
  1302. - rfc3442-classless-static-routes
  1303. - ntp-servers
  1304. require:
  1305. - subnet-mask
  1306. - domain-name-servers
  1307. # if per interface configuration required add below
  1308. interface:
  1309. ens2:
  1310. initial_interval: 11
  1311. reject:
  1312. - 192.33.137.210
  1313. ens3:
  1314. initial_interval: 12
  1315. reject:
  1316. - 192.33.137.211
  1317. Linux network systemd settings:
  1318. .. code-block:: yaml
  1319. linux:
  1320. network:
  1321. ...
  1322. systemd:
  1323. link:
  1324. 10-iface-dmz:
  1325. Match:
  1326. MACAddress: c8:5b:67:fa:1a:af
  1327. OriginalName: eth0
  1328. Link:
  1329. Name: dmz0
  1330. netdev:
  1331. 20-bridge-dmz:
  1332. match:
  1333. name: dmz0
  1334. network:
  1335. mescription: bridge
  1336. bridge: br-dmz0
  1337. network:
  1338. # works with lowercase, keys are by default capitalized
  1339. 40-dhcp:
  1340. match:
  1341. name: '*'
  1342. network:
  1343. DHCP: yes
  1344. Configure global environment variables
  1345. Use ``/etc/environment`` for static system wide variable assignment
  1346. after boot. Variable expansion is frequently not supported.
  1347. .. code-block:: yaml
  1348. linux:
  1349. system:
  1350. env:
  1351. BOB_VARIABLE: Alice
  1352. ...
  1353. BOB_PATH:
  1354. - /srv/alice/bin
  1355. - /srv/bob/bin
  1356. ...
  1357. ftp_proxy: none
  1358. http_proxy: http://global-http-proxy.host.local:8080
  1359. https_proxy: ${linux:system:proxy:https}
  1360. no_proxy:
  1361. - 192.168.0.80
  1362. - 192.168.1.80
  1363. - .domain.com
  1364. - .local
  1365. ...
  1366. # NOTE: global defaults proxy configuration.
  1367. proxy:
  1368. ftp: ftp://proxy.host.local:2121
  1369. http: http://proxy.host.local:3142
  1370. https: https://proxy.host.local:3143
  1371. noproxy:
  1372. - .domain.com
  1373. - .local
  1374. Configure the ``profile.d`` scripts
  1375. The ``profile.d`` scripts are being sourced during ``.sh`` execution
  1376. and support variable expansion in opposite to /etc/environment global
  1377. settings in ``/etc/environment``.
  1378. .. code-block:: yaml
  1379. linux:
  1380. system:
  1381. profile:
  1382. locales: |
  1383. export LANG=C
  1384. export LC_ALL=C
  1385. ...
  1386. vi_flavors.sh: |
  1387. export PAGER=view
  1388. export EDITOR=vim
  1389. alias vi=vim
  1390. shell_locales.sh: |
  1391. export LANG=en_US
  1392. export LC_ALL=en_US.UTF-8
  1393. shell_proxies.sh: |
  1394. export FTP_PROXY=ftp://127.0.3.3:2121
  1395. export NO_PROXY='.local'
  1396. Configure login.defs parameters
  1397. -------------------------------
  1398. .. code-block:: yaml
  1399. linux:
  1400. system:
  1401. login_defs:
  1402. <opt_name>:
  1403. enabled: true
  1404. value: <opt_value>
  1405. <opt_name> is a configurational option defined in 'man login.defs'.
  1406. <opt_name> is case sensitive, should be UPPERCASE only!
  1407. Linux with hosts
  1408. Parameter ``purge_hosts`` will enforce whole ``/etc/hosts file``,
  1409. removing entries that are not defined in model except defaults
  1410. for both IPv4 and IPv6 localhost and hostname as well as FQDN.
  1411. We recommend using this option to verify that ``/etc/hosts``
  1412. is always in a clean state. However it is not enabled by default
  1413. for security reasons.
  1414. .. code-block:: yaml
  1415. linux:
  1416. network:
  1417. purge_hosts: true
  1418. host:
  1419. # No need to define this one if purge_hosts is true
  1420. hostname:
  1421. address: 127.0.1.1
  1422. names:
  1423. - ${linux:network:fqdn}
  1424. - ${linux:network:hostname}
  1425. node1:
  1426. address: 192.168.10.200
  1427. names:
  1428. - node2.domain.com
  1429. - service2.domain.com
  1430. node2:
  1431. address: 192.168.10.201
  1432. names:
  1433. - node2.domain.com
  1434. - service2.domain.com
  1435. Linux with hosts collected from mine
  1436. All DNS records defined within infrastrucuture
  1437. are passed to the local hosts records or any DNS server. Only
  1438. hosts with the ``grain`` parameter set to ``true`` will be propagated
  1439. to the mine.
  1440. .. code-block:: yaml
  1441. linux:
  1442. network:
  1443. purge_hosts: true
  1444. mine_dns_records: true
  1445. host:
  1446. node1:
  1447. address: 192.168.10.200
  1448. grain: true
  1449. names:
  1450. - node2.domain.com
  1451. - service2.domain.com
  1452. Set up ``resolv.conf``, nameservers, domain and search domains:
  1453. .. code-block:: yaml
  1454. linux:
  1455. network:
  1456. resolv:
  1457. dns:
  1458. - 8.8.4.4
  1459. - 8.8.8.8
  1460. domain: my.example.com
  1461. search:
  1462. - my.example.com
  1463. - example.com
  1464. options:
  1465. - ndots: 5
  1466. - timeout: 2
  1467. - attempts: 2
  1468. Set up custom TX queue length for tap interfaces:
  1469. .. code-block:: yaml
  1470. linux:
  1471. network:
  1472. tap_custom_txqueuelen: 10000
  1473. Open vSwitch native bond:
  1474. .. code-block:: yaml
  1475. bond1:
  1476. enabled: true
  1477. type: ovs_bond
  1478. mode: balance-slb
  1479. bridge: br-ex
  1480. slaves: eno3 eno4
  1481. DPDK OVS interfaces
  1482. **DPDK OVS NIC**
  1483. .. code-block:: yaml
  1484. linux:
  1485. network:
  1486. bridge: openvswitch
  1487. dpdk:
  1488. enabled: true
  1489. driver: uio/vfio
  1490. openvswitch:
  1491. pmd_cpu_mask: "0x6"
  1492. dpdk_socket_mem: "1024,1024"
  1493. dpdk_lcore_mask: "0x400"
  1494. memory_channels: 2
  1495. interface:
  1496. dpkd0:
  1497. name: ${_param:dpdk_nic}
  1498. pci: 0000:06:00.0
  1499. driver: igb_uio/vfio-pci
  1500. enabled: true
  1501. type: dpdk_ovs_port
  1502. n_rxq: 2
  1503. pmd_rxq_affinity: "0:1,1:2"
  1504. bridge: br-prv
  1505. mtu: 9000
  1506. br-prv:
  1507. enabled: true
  1508. type: dpdk_ovs_bridge
  1509. **DPDK OVS Bond**
  1510. .. code-block:: yaml
  1511. linux:
  1512. network:
  1513. bridge: openvswitch
  1514. dpdk:
  1515. enabled: true
  1516. driver: uio/vfio
  1517. openvswitch:
  1518. pmd_cpu_mask: "0x6"
  1519. dpdk_socket_mem: "1024,1024"
  1520. dpdk_lcore_mask: "0x400"
  1521. memory_channels: 2
  1522. interface:
  1523. dpdk_second_nic:
  1524. name: ${_param:primary_second_nic}
  1525. pci: 0000:06:00.0
  1526. driver: igb_uio/vfio-pci
  1527. bond: dpdkbond0
  1528. enabled: true
  1529. type: dpdk_ovs_port
  1530. n_rxq: 2
  1531. pmd_rxq_affinity: "0:1,1:2"
  1532. mtu: 9000
  1533. dpdk_first_nic:
  1534. name: ${_param:primary_first_nic}
  1535. pci: 0000:05:00.0
  1536. driver: igb_uio/vfio-pci
  1537. bond: dpdkbond0
  1538. enabled: true
  1539. type: dpdk_ovs_port
  1540. n_rxq: 2
  1541. pmd_rxq_affinity: "0:1,1:2"
  1542. mtu: 9000
  1543. dpdkbond0:
  1544. enabled: true
  1545. bridge: br-prv
  1546. type: dpdk_ovs_bond
  1547. mode: active-backup
  1548. br-prv:
  1549. enabled: true
  1550. type: dpdk_ovs_bridge
  1551. **DPDK OVS LACP Bond with vlan tag**
  1552. .. code-block:: yaml
  1553. linux:
  1554. network:
  1555. bridge: openvswitch
  1556. dpdk:
  1557. enabled: true
  1558. driver: uio
  1559. openvswitch:
  1560. pmd_cpu_mask: "0x6"
  1561. dpdk_socket_mem: "1024,1024"
  1562. dpdk_lcore_mask: "0x400"
  1563. memory_channels: "2"
  1564. interface:
  1565. eth3:
  1566. enabled: true
  1567. type: eth
  1568. proto: manual
  1569. name: ${_param:tenant_first_nic}
  1570. eth4:
  1571. enabled: true
  1572. type: eth
  1573. proto: manual
  1574. name: ${_param:tenant_second_nic}
  1575. dpdk0:
  1576. name: ${_param:tenant_first_nic}
  1577. pci: "0000:81:00.0"
  1578. driver: igb_uio
  1579. bond: bond1
  1580. enabled: true
  1581. type: dpdk_ovs_port
  1582. n_rxq: 2
  1583. dpdk1:
  1584. name: ${_param:tenant_second_nic}
  1585. pci: "0000:81:00.1"
  1586. driver: igb_uio
  1587. bond: bond1
  1588. enabled: true
  1589. type: dpdk_ovs_port
  1590. n_rxq: 2
  1591. bond1:
  1592. enabled: true
  1593. bridge: br-prv
  1594. type: dpdk_ovs_bond
  1595. mode: balance-slb
  1596. br-prv:
  1597. enabled: true
  1598. type: dpdk_ovs_bridge
  1599. tag: ${_param:tenant_vlan}
  1600. address: ${_param:tenant_address}
  1601. netmask: ${_param:tenant_network_netmask}
  1602. **DPDK OVS bridge for VXLAN**
  1603. If VXLAN is used as tenant segmentation, IP address must
  1604. be set on ``br-prv``.
  1605. .. code-block:: yaml
  1606. linux:
  1607. network:
  1608. ...
  1609. interface:
  1610. br-prv:
  1611. enabled: true
  1612. type: dpdk_ovs_bridge
  1613. address: 192.168.50.0
  1614. netmask: 255.255.255.0
  1615. tag: 101
  1616. mtu: 9000
  1617. **DPDK OVS bridge with Linux network interface**
  1618. .. code-block:: yaml
  1619. linux:
  1620. network:
  1621. ...
  1622. interface:
  1623. eth0:
  1624. type: eth
  1625. ovs_bridge: br-prv
  1626. ...
  1627. br-prv:
  1628. enabled: true
  1629. type: dpdk_ovs_bridge
  1630. ...
  1631. Linux storage
  1632. -------------
  1633. Linux with mounted Samba:
  1634. .. code-block:: yaml
  1635. linux:
  1636. storage:
  1637. enabled: true
  1638. mount:
  1639. samba1:
  1640. - enabled: true
  1641. - path: /media/myuser/public/
  1642. - device: //192.168.0.1/storage
  1643. - file_system: cifs
  1644. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  1645. NFS mount:
  1646. .. code-block:: yaml
  1647. linux:
  1648. storage:
  1649. enabled: true
  1650. mount:
  1651. nfs_glance:
  1652. enabled: true
  1653. path: /var/lib/glance/images
  1654. device: 172.16.10.110:/var/nfs/glance
  1655. file_system: nfs
  1656. opts: rw,sync
  1657. File swap configuration:
  1658. .. code-block:: yaml
  1659. linux:
  1660. storage:
  1661. enabled: true
  1662. swap:
  1663. file:
  1664. enabled: true
  1665. engine: file
  1666. device: /swapfile
  1667. size: 1024
  1668. Partition swap configuration:
  1669. .. code-block:: yaml
  1670. linux:
  1671. storage:
  1672. enabled: true
  1673. swap:
  1674. partition:
  1675. enabled: true
  1676. engine: partition
  1677. device: /dev/vg0/swap
  1678. LVM group ``vg1`` with one device and ``data`` volume mounted
  1679. into ``/mnt/data``.
  1680. .. code-block:: yaml
  1681. parameters:
  1682. linux:
  1683. storage:
  1684. mount:
  1685. data:
  1686. enabled: true
  1687. device: /dev/vg1/data
  1688. file_system: ext4
  1689. path: /mnt/data
  1690. lvm:
  1691. vg1:
  1692. enabled: true
  1693. devices:
  1694. - /dev/sdb
  1695. volume:
  1696. data:
  1697. size: 40G
  1698. mount: ${linux:storage:mount:data}
  1699. Create partitions on disk. Specify size in MB. It expects empty
  1700. disk without any existing partitions.
  1701. Set ``startsector=1`` if you want to start partitions from ``2048``.
  1702. .. code-block:: yaml
  1703. linux:
  1704. storage:
  1705. disk:
  1706. first_drive:
  1707. startsector: 1
  1708. name: /dev/loop1
  1709. type: gpt
  1710. partitions:
  1711. - size: 200 #size in MB
  1712. type: fat32
  1713. - size: 300 #size in MB
  1714. mkfs: True
  1715. type: xfs
  1716. /dev/vda1:
  1717. partitions:
  1718. - size: 5
  1719. type: ext2
  1720. - size: 10
  1721. type: ext4
  1722. Multipath with Fujitsu Eternus DXL:
  1723. .. code-block:: yaml
  1724. parameters:
  1725. linux:
  1726. storage:
  1727. multipath:
  1728. enabled: true
  1729. blacklist_devices:
  1730. - /dev/sda
  1731. - /dev/sdb
  1732. backends:
  1733. - fujitsu_eternus_dxl
  1734. Multipath with Hitachi VSP 1000:
  1735. .. code-block:: yaml
  1736. parameters:
  1737. linux:
  1738. storage:
  1739. multipath:
  1740. enabled: true
  1741. blacklist_devices:
  1742. - /dev/sda
  1743. - /dev/sdb
  1744. backends:
  1745. - hitachi_vsp1000
  1746. Multipath with IBM Storwize:
  1747. .. code-block:: yaml
  1748. parameters:
  1749. linux:
  1750. storage:
  1751. multipath:
  1752. enabled: true
  1753. blacklist_devices:
  1754. - /dev/sda
  1755. - /dev/sdb
  1756. backends:
  1757. - ibm_storwize
  1758. Multipath with multiple backends:
  1759. .. code-block:: yaml
  1760. parameters:
  1761. linux:
  1762. storage:
  1763. multipath:
  1764. enabled: true
  1765. blacklist_devices:
  1766. - /dev/sda
  1767. - /dev/sdb
  1768. - /dev/sdc
  1769. - /dev/sdd
  1770. backends:
  1771. - ibm_storwize
  1772. - fujitsu_eternus_dxl
  1773. - hitachi_vsp1000
  1774. PAM LDAP integration:
  1775. .. code-block:: yaml
  1776. parameters:
  1777. linux:
  1778. system:
  1779. auth:
  1780. enabled: true
  1781. mkhomedir:
  1782. enabled: true
  1783. umask: 0027
  1784. ldap:
  1785. enabled: true
  1786. binddn: cn=bind,ou=service_users,dc=example,dc=com
  1787. bindpw: secret
  1788. uri: ldap://127.0.0.1
  1789. base: ou=users,dc=example,dc=com
  1790. ldap_version: 3
  1791. pagesize: 65536
  1792. referrals: off
  1793. filter:
  1794. passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1795. shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1796. group: (&(objectClass=group)(gidNumber=*))
  1797. PAM duo 2FA integration
  1798. .. code-block:: yaml
  1799. parameters:
  1800. linux:
  1801. system:
  1802. auth:
  1803. enabled: true
  1804. duo:
  1805. enabled: true
  1806. duo_host: localhost
  1807. duo_ikey: DUO-INTEGRATION-KEY
  1808. duo_skey: DUO-SECRET-KEY
  1809. duo package version may be specified (optional)
  1810. .. code-block:: yaml
  1811. linux:
  1812. system:
  1813. package:
  1814. duo-unix:
  1815. version: 1.10.1-0
  1816. Disabled multipath (the default setup):
  1817. .. code-block:: yaml
  1818. parameters:
  1819. linux:
  1820. storage:
  1821. multipath:
  1822. enabled: false
  1823. Linux with local loopback device:
  1824. .. code-block:: yaml
  1825. linux:
  1826. storage:
  1827. loopback:
  1828. disk1:
  1829. file: /srv/disk1
  1830. size: 50G
  1831. External config generation
  1832. --------------------------
  1833. You are able to use config support metadata between formulas
  1834. and only generate configuration files for external use, for example, Docker, and so on.
  1835. .. code-block:: yaml
  1836. parameters:
  1837. linux:
  1838. system:
  1839. config:
  1840. pillar:
  1841. jenkins:
  1842. master:
  1843. home: /srv/volumes/jenkins
  1844. approved_scripts:
  1845. - method java.net.URL openConnection
  1846. credentials:
  1847. - type: username_password
  1848. scope: global
  1849. id: test
  1850. desc: Testing credentials
  1851. username: test
  1852. password: test
  1853. Netconsole Remote Kernel Logging
  1854. --------------------------------
  1855. Netconsole logger can be configured for the configfs-enabled kernels
  1856. (``CONFIG_NETCONSOLE_DYNAMIC`` must be enabled). The configuration
  1857. applies both in runtime (if network is already configured),
  1858. and on-boot after an interface initialization.
  1859. .. note::
  1860. * Receiver can be located only on the same L3 domain
  1861. (or you need to configure gateway MAC manually).
  1862. * The Receiver MAC is detected only on configuration time.
  1863. * Using broadcast MAC is not recommended.
  1864. .. code-block:: yaml
  1865. parameters:
  1866. linux:
  1867. system:
  1868. netconsole:
  1869. enabled: true
  1870. port: 514 (optional)
  1871. loglevel: debug (optional)
  1872. target:
  1873. 192.168.0.1:
  1874. interface: bond0
  1875. mac: "ff:ff:ff:ff:ff:ff" (optional)
  1876. Check network params on the environment
  1877. ---------------------------------------
  1878. Grab nics and nics states
  1879. .. code-block:: bash
  1880. salt osd001\* net_checks.get_nics
  1881. **Example of system output:**
  1882. .. code-block:: bash
  1883. osd001.domain.com:
  1884. |_
  1885. - bond0
  1886. - None
  1887. - 1e:c8:64:42:23:b9
  1888. - 0
  1889. - 1500
  1890. |_
  1891. - bond1
  1892. - None
  1893. - 3c:fd:fe:27:3b:00
  1894. - 1
  1895. - 9100
  1896. |_
  1897. - fourty1
  1898. - None
  1899. - 3c:fd:fe:27:3b:00
  1900. - 1
  1901. - 9100
  1902. |_
  1903. - fourty2
  1904. - None
  1905. - 3c:fd:fe:27:3b:02
  1906. - 1
  1907. - 9100
  1908. Grab 10G nics PCI addresses for hugepages setup
  1909. .. code-block:: bash
  1910. salt cmp001\* net_checks.get_ten_pci
  1911. **Example of system output:**
  1912. .. code-block:: bash
  1913. cmp001.domain.com:
  1914. |_
  1915. - ten1
  1916. - 0000:19:00.0
  1917. |_
  1918. - ten2
  1919. - 0000:19:00.1
  1920. |_
  1921. - ten3
  1922. - 0000:19:00.2
  1923. |_
  1924. - ten4
  1925. - 0000:19:00.3
  1926. Grab ip address for an interface
  1927. .. code-block:: bash
  1928. salt cmp001\* net_checks.get_ip iface=one4
  1929. **Example of system output:**
  1930. .. code-block:: bash
  1931. cmp001.domain.com:
  1932. 10.200.177.101
  1933. Grab ip addresses map
  1934. .. code-block:: bash
  1935. salt-call net_checks.nodes_addresses
  1936. **Example of system output:**
  1937. .. code-block:: bash
  1938. local:
  1939. |_
  1940. - cid01.domain.com
  1941. |_
  1942. |_
  1943. - pxe
  1944. - 10.200.177.91
  1945. |_
  1946. - control
  1947. - 10.200.178.91
  1948. |_
  1949. - cmn02.domain.com
  1950. |_
  1951. |_
  1952. - storage_access
  1953. - 10.200.181.67
  1954. |_
  1955. - pxe
  1956. - 10.200.177.67
  1957. |_
  1958. - control
  1959. - 10.200.178.67
  1960. |_
  1961. - cmp010.domain.com
  1962. |_
  1963. |_
  1964. - pxe
  1965. - 10.200.177.110
  1966. |_
  1967. - storage_access
  1968. - 10.200.181.110
  1969. |_
  1970. - control
  1971. - 10.200.178.110
  1972. |_
  1973. - vxlan
  1974. - 10.200.179.110
  1975. Verify full mesh connectivity
  1976. .. code-block:: bash
  1977. salt-call net_checks.ping_check
  1978. **Example of positive system output:**
  1979. .. code-block:: bash
  1980. ['PASSED']
  1981. [INFO ] ['PASSED']
  1982. local:
  1983. True
  1984. **Example of system output in case of failure:**
  1985. .. code-block:: bash
  1986. FAILED
  1987. [ERROR ] FAILED
  1988. ['control: 10.0.1.92 -> 10.0.1.224: Failed']
  1989. ['control: 10.0.1.93 -> 10.0.1.224: Failed']
  1990. ['control: 10.0.1.51 -> 10.0.1.224: Failed']
  1991. ['control: 10.0.1.102 -> 10.0.1.224: Failed']
  1992. ['control: 10.0.1.13 -> 10.0.1.224: Failed']
  1993. ['control: 10.0.1.81 -> 10.0.1.224: Failed']
  1994. local:
  1995. False
  1996. For this feature to work, please mark addresses with some role.
  1997. Otherwise 'default' role is assumed and mesh would consist of all
  1998. addresses on the environment.
  1999. Mesh mark is needed only for interfaces which are enabled and have
  2000. ip address assigned.
  2001. Checking dhcp pxe network meaningless, as it is used for salt
  2002. master vs minion communications, therefore treated as checked.
  2003. .. code-block:: yaml
  2004. parameters:
  2005. linux:
  2006. network:
  2007. interface:
  2008. ens3:
  2009. enabled: true
  2010. type: eth
  2011. proto: static
  2012. address: ${_param:deploy_address}
  2013. netmask: ${_param:deploy_network_netmask}
  2014. gateway: ${_param:deploy_network_gateway}
  2015. mesh: pxe
  2016. Check pillars for ip address duplicates
  2017. .. code-block:: bash
  2018. salt-call net_checks.verify_addresses
  2019. **Example of positive system output:**
  2020. .. code-block:: bash
  2021. ['PASSED']
  2022. [INFO ] ['PASSED']
  2023. local:
  2024. True
  2025. **Example of system output in case of failure:**
  2026. .. code-block:: bash
  2027. FAILED. Duplicates found
  2028. [ERROR ] FAILED. Duplicates found
  2029. ['gtw01.domain.com', 'gtw02.domain.com', '10.0.1.224']
  2030. [ERROR ] ['gtw01.domain.com', 'gtw02.domain.com', '10.0.1.224']
  2031. local:
  2032. False
  2033. Generate csv report for the env
  2034. .. code-block:: bash
  2035. salt -C 'kvm* or cmp* or osd*' net_checks.get_nics_csv \
  2036. | grep '^\ ' | sed 's/\ *//g' | grep -Ev ^server \
  2037. | sed '1 i\server,nic_name,ip_addr,mac_addr,link,mtu,chassis_id,chassis_name,port_mac,port_descr'
  2038. **Example of system output:**
  2039. .. code-block:: bash
  2040. server,nic_name,ip_addr,mac_addr,link,mtu,chassis_id,chassis_name,port_mac,port_descr
  2041. cmp010.domain.com,bond0,None,b4:96:91:10:5b:3a,1,1500,,,,
  2042. cmp010.domain.com,bond0.21,10.200.178.110,b4:96:91:10:5b:3a,1,1500,,,,
  2043. cmp010.domain.com,bond0.22,10.200.179.110,b4:96:91:10:5b:3a,1,1500,,,,
  2044. cmp010.domain.com,bond1,None,3c:fd:fe:34:ad:22,0,1500,,,,
  2045. cmp010.domain.com,bond1.24,10.200.181.110,3c:fd:fe:34:ad:22,0,1500,,,,
  2046. cmp010.domain.com,fourty5,None,3c:fd:fe:34:ad:20,0,9000,,,,
  2047. cmp010.domain.com,fourty6,None,3c:fd:fe:34:ad:22,0,9000,,,,
  2048. cmp010.domain.com,one1,None,b4:96:91:10:5b:38,0,1500,,,,
  2049. cmp010.domain.com,one2,None,b4:96:91:10:5b:39,1,1500,f0:4b:3a:8f:75:40,exnfvaa18-20,548,ge-0/0/22
  2050. cmp010.domain.com,one3,None,b4:96:91:10:5b:3a,1,1500,f0:4b:3a:8f:75:40,exnfvaa18-20,547,ge-0/0/21
  2051. cmp010.domain.com,one4,10.200.177.110,b4:96:91:10:5b:3b,1,1500,f0:4b:3a:8f:75:40,exnfvaa18-20,546,ge-0/0/20
  2052. cmp011.domain.com,bond0,None,b4:96:91:13:6c:aa,1,1500,,,,
  2053. cmp011.domain.com,bond0.21,10.200.178.111,b4:96:91:13:6c:aa,1,1500,,,,
  2054. cmp011.domain.com,bond0.22,10.200.179.111,b4:96:91:13:6c:aa,1,1500,,,,
  2055. ...
  2056. Usage
  2057. =====
  2058. Set MTU of the eth0 network interface to 1400:
  2059. .. code-block:: bash
  2060. ip link set dev eth0 mtu 1400
  2061. Read more
  2062. =========
  2063. * https://www.archlinux.org/
  2064. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
  2065. Documentation and Bugs
  2066. ======================
  2067. * http://salt-formulas.readthedocs.io/
  2068. Learn how to install and update salt-formulas.
  2069. * https://github.com/salt-formulas/salt-formula-linux/issues
  2070. In the unfortunate event that bugs are discovered, report the issue to the
  2071. appropriate issue tracker. Use the Github issue tracker for a specific salt
  2072. formula.
  2073. * https://launchpad.net/salt-formulas
  2074. For feature requests, bug reports, or blueprints affecting the entire
  2075. ecosystem, use the Launchpad salt-formulas project.
  2076. * https://launchpad.net/~salt-formulas-users
  2077. Join the salt-formulas-users team and subscribe to mailing list if required.
  2078. * https://github.com/salt-formulas/salt-formula-linux
  2079. Develop the salt-formulas projects in the master branch and then submit pull
  2080. requests against a specific formula.
  2081. * #salt-formulas @ irc.freenode.net
  2082. Use this IRC channel in case of any questions or feedback which is always
  2083. welcome.