Saltstack Official Linux Formula
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

7 anos atrás
9 anos atrás
9 anos atrás
7 anos atrás
9 anos atrás
7 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
7 anos atrás
7 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
8 anos atrás
8 anos atrás
8 anos atrás
8 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
7 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
9 anos atrás
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585
  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. Alternative way to set kernel boot options:
  571. .. code-block:: yaml
  572. linux:
  573. system:
  574. kernel:
  575. transparent_hugepage: always
  576. elevator: deadline
  577. isolcpu: 1,2,3,4
  578. CPU
  579. ~~~
  580. Enable cpufreq governor for every cpu:
  581. .. code-block:: yaml
  582. linux:
  583. system:
  584. cpu:
  585. governor: performance
  586. SELinux
  587. ~~~~~~~
  588. Set SELinux mode on System:
  589. .. code-block:: yaml
  590. linux:
  591. system:
  592. selinux: permissive
  593. CGROUPS
  594. ~~~~~~~
  595. Setup linux cgroups:
  596. .. code-block:: yaml
  597. linux:
  598. system:
  599. cgroup:
  600. enabled: true
  601. group:
  602. ceph_group_1:
  603. controller:
  604. cpu:
  605. shares:
  606. value: 250
  607. cpuacct:
  608. usage:
  609. value: 0
  610. cpuset:
  611. cpus:
  612. value: 1,2,3
  613. memory:
  614. limit_in_bytes:
  615. value: 2G
  616. memsw.limit_in_bytes:
  617. value: 3G
  618. mapping:
  619. subjects:
  620. - '@ceph'
  621. generic_group_1:
  622. controller:
  623. cpu:
  624. shares:
  625. value: 250
  626. cpuacct:
  627. usage:
  628. value: 0
  629. mapping:
  630. subjects:
  631. - '*:firefox'
  632. - 'student:cp'
  633. Shared libraries
  634. ~~~~~~~~~~~~~~~~
  635. Set additional shared library to Linux system library path:
  636. .. code-block:: yaml
  637. linux:
  638. system:
  639. ld:
  640. library:
  641. java:
  642. - /usr/lib/jvm/jre-openjdk/lib/amd64/server
  643. - /opt/java/jre/lib/amd64/server
  644. Certificates
  645. ~~~~~~~~~~~~
  646. Add certificate authority into system trusted CA bundle:
  647. .. code-block:: yaml
  648. linux:
  649. system:
  650. ca_certificates:
  651. mycert: |
  652. -----BEGIN CERTIFICATE-----
  653. MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
  654. A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
  655. cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
  656. MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
  657. BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
  658. YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
  659. ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
  660. BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
  661. I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
  662. CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
  663. lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
  664. AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
  665. -----END CERTIFICATE-----
  666. Sysfs
  667. ~~~~~
  668. Install sysfsutils and set sysfs attributes:
  669. .. code-block:: yaml
  670. linux:
  671. system:
  672. sysfs:
  673. scheduler:
  674. block/sda/queue/scheduler: deadline
  675. power:
  676. mode:
  677. power/state: 0660
  678. owner:
  679. power/state: "root:power"
  680. devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
  681. Optional: You can also use list that will ensure order of items.
  682. .. code-block:: yaml
  683. linux:
  684. system:
  685. sysfs:
  686. scheduler:
  687. block/sda/queue/scheduler: deadline
  688. power:
  689. - mode:
  690. power/state: 0660
  691. - owner:
  692. power/state: "root:power"
  693. - devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
  694. Sysfs definition with disabled automatic write. Attributes are saved
  695. to configuration, but are not applied during the run.
  696. Thay will be applied automatically after the reboot.
  697. .. code-block:: yaml
  698. linux:
  699. system:
  700. sysfs:
  701. enable_apply: false
  702. scheduler:
  703. block/sda/queue/scheduler: deadline
  704. .. note:: The `enable_apply` parameter defaults to `True` if not defined.
  705. Huge Pages
  706. ~~~~~~~~~~~~
  707. Huge Pages give a performance boost to applications that intensively deal
  708. with memory allocation/deallocation by decreasing memory fragmentation:
  709. .. code-block:: yaml
  710. linux:
  711. system:
  712. kernel:
  713. hugepages:
  714. small:
  715. size: 2M
  716. count: 107520
  717. mount_point: /mnt/hugepages_2MB
  718. mount: false/true # default is true (mount immediately) / false (just save in the fstab)
  719. large:
  720. default: true # default automatically mounted
  721. size: 1G
  722. count: 210
  723. mount_point: /mnt/hugepages_1GB
  724. .. note:: Not recommended to use both pagesizes concurrently.
  725. Intel SR-IOV
  726. ~~~~~~~~~~~~
  727. PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV)
  728. specification defines a standardized mechanism to virtualize
  729. PCIe devices. The mechanism can virtualize a single PCIe
  730. Ethernet controller to appear as multiple PCIe devices:
  731. .. code-block:: yaml
  732. linux:
  733. system:
  734. kernel:
  735. sriov: True
  736. unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
  737. rc:
  738. local: |
  739. #!/bin/sh -e
  740. # Enable 7 VF on eth1
  741. echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
  742. exit 0
  743. Isolate CPU options
  744. ~~~~~~~~~~~~~~~~~~~
  745. Remove the specified CPUs, as defined by the cpu_number values, from
  746. the general kernel SMP balancing and scheduler algroithms. The only
  747. way to move a process onto or off an *isolated* CPU is via the CPU
  748. affinity syscalls. ``cpu_number begins`` at ``0``, so the
  749. maximum value is ``1`` less than the number of CPUs on the system.:
  750. .. code-block:: yaml
  751. linux:
  752. system:
  753. kernel:
  754. isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
  755. Repositories
  756. ~~~~~~~~~~~~
  757. RedHat-based Linux with additional OpenStack repo:
  758. .. code-block:: yaml
  759. linux:
  760. system:
  761. ...
  762. repo:
  763. rdo-icehouse:
  764. enabled: true
  765. source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
  766. pgpcheck: 0
  767. Ensure system repository to use czech Debian mirror (``default: true``)
  768. Also pin it's packages with priority ``900``:
  769. .. code-block:: yaml
  770. linux:
  771. system:
  772. repo:
  773. debian:
  774. default: true
  775. source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
  776. # Import signing key from URL if needed
  777. key_url: "http://dummy.com/public.gpg"
  778. pin:
  779. - pin: 'origin "ftp.cz.debian.org"'
  780. priority: 900
  781. package: '*'
  782. If you need to add multiple pin rules for one repo, please use new,ordered definition format
  783. ('pinning' definition will be in priotity to use):
  784. .. code-block:: yaml
  785. linux:
  786. system:
  787. repo:
  788. mcp_saltstack:
  789. source: "deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/ xenial main"
  790. architectures: amd64
  791. clean_file: true
  792. pinning:
  793. 10:
  794. enabled: true
  795. pin: 'release o=SaltStack'
  796. priority: 50
  797. package: 'libsodium18'
  798. 20:
  799. enabled: true
  800. pin: 'release o=SaltStack'
  801. priority: 1100
  802. package: '*'
  803. .. note:: For old Ubuntu releases (<xenial)
  804. extra packages for apt transport, like ``apt-transport-https``
  805. may be required to be installed manually.
  806. (Chicken-eggs issue: we need to install packages to
  807. reach repo from where they should be installed)
  808. Otherwise, you still can try 'fortune' and install prereq.packages before
  809. any repo configuration, using list of requires in map.jinja.
  810. Disabling any prerequisite packages installation:
  811. You can simply drop any package pre-installation (before system.linux.repo
  812. will be processed) via cluster lvl:
  813. .. code-block:: yaml
  814. linux:
  815. system:
  816. pkgs: ~
  817. Package manager proxy global setup:
  818. .. code-block:: yaml
  819. linux:
  820. system:
  821. ...
  822. repo:
  823. apt-mk:
  824. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  825. ...
  826. proxy:
  827. pkg:
  828. enabled: true
  829. ftp: ftp://ftp-proxy-for-apt.host.local:2121
  830. ...
  831. # NOTE: Global defaults for any other componet that configure proxy on the system.
  832. # If your environment has just one simple proxy, set it on linux:system:proxy.
  833. #
  834. # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
  835. # as for https and http
  836. ftp: ftp://proxy.host.local:2121
  837. http: http://proxy.host.local:3142
  838. https: https://proxy.host.local:3143
  839. Package manager proxy setup per repository:
  840. .. code-block:: yaml
  841. linux:
  842. system:
  843. ...
  844. repo:
  845. debian:
  846. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  847. ...
  848. apt-mk:
  849. source: "deb http://apt-mk.mirantis.com/ stable main salt"
  850. # per repository proxy
  851. proxy:
  852. enabled: true
  853. http: http://maas-01:8080
  854. https: http://maas-01:8080
  855. ...
  856. proxy:
  857. # package manager fallback defaults
  858. # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
  859. pkg:
  860. enabled: true
  861. ftp: ftp://proxy.host.local:2121
  862. #http: http://proxy.host.local:3142
  863. #https: https://proxy.host.local:3143
  864. ...
  865. # global system fallback system defaults
  866. ftp: ftp://proxy.host.local:2121
  867. http: http://proxy.host.local:3142
  868. https: https://proxy.host.local:3143
  869. Remove all repositories:
  870. .. code-block:: yaml
  871. linux:
  872. system:
  873. purge_repos: true
  874. Refresh repositories metada, after configuration:
  875. .. code-block:: yaml
  876. linux:
  877. system:
  878. refresh_repos_meta: true
  879. Setup custom apt config options:
  880. .. code-block:: yaml
  881. linux:
  882. system:
  883. apt:
  884. config:
  885. compression-workaround:
  886. "Acquire::CompressionTypes::Order": "gz"
  887. docker-clean:
  888. "DPkg::Post-Invoke":
  889. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  890. "APT::Update::Post-Invoke":
  891. - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
  892. RC
  893. ~~
  894. rc.local example
  895. .. code-block:: yaml
  896. linux:
  897. system:
  898. rc:
  899. local: |
  900. #!/bin/sh -e
  901. #
  902. # rc.local
  903. #
  904. # This script is executed at the end of each multiuser runlevel.
  905. # Make sure that the script will "exit 0" on success or any other
  906. # value on error.
  907. #
  908. # In order to enable or disable this script just change the execution
  909. # bits.
  910. #
  911. # By default this script does nothing.
  912. exit 0
  913. Prompt
  914. ~~~~~~
  915. Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``.
  916. Every user can have different prompt:
  917. .. code-block:: yaml
  918. linux:
  919. system:
  920. prompt:
  921. 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\\]
  922. default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
  923. On Debian systems, to set prompt system-wide, it's necessary to
  924. remove setting PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc``,
  925. which comes from ``/etc/skel/.bashrc``. This formula will do
  926. this automatically, but will not touch existing user's
  927. ``~/.bashrc`` files except root.
  928. Bash
  929. ~~~~
  930. Fix bash configuration to preserve history across sessions
  931. like ZSH does by default:
  932. .. code-block:: yaml
  933. linux:
  934. system:
  935. bash:
  936. preserve_history: true
  937. Login banner message
  938. ~~~~~~~~~~~~~~~~~~~~
  939. ``/etc/issue`` is a text file which contains a message or system
  940. identification to be printed before the login prompt. It may contain
  941. various @char and \char sequences, if supported by the getty-type
  942. program employed on the system.
  943. Setting logon banner message is easy:
  944. .. code-block:: yaml
  945. liunx:
  946. system:
  947. banner:
  948. enabled: true
  949. contents: |
  950. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  951. You must have explicit, authorized permission to access or configure this
  952. device. Unauthorized attempts and actions to access or use this system may
  953. result in civil and/or criminal penalties.
  954. All activities performed on this system are logged and monitored.
  955. Message of the day
  956. ~~~~~~~~~~~~~~~~~~
  957. ``pam_motd`` from package ``libpam-modules`` is used for dynamic
  958. messages of the day. Setting custom ``motd`` will clean up existing ones.
  959. Setting static ``motd`` will replace existing ``/etc/motd`` and remove
  960. scripts from ``/etc/update-motd.d``.
  961. Setting static ``motd``:
  962. .. code-block:: yaml
  963. linux:
  964. system:
  965. motd: |
  966. UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
  967. You must have explicit, authorized permission to access or configure this
  968. device. Unauthorized attempts and actions to access or use this system may
  969. result in civil and/or criminal penalties.
  970. All activities performed on this system are logged and monitored.
  971. Setting dynamic ``motd``:
  972. .. code-block:: yaml
  973. linux:
  974. system:
  975. motd:
  976. - release: |
  977. #!/bin/sh
  978. [ -r /etc/lsb-release ] && . /etc/lsb-release
  979. if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
  980. # Fall back to using the very slow lsb_release utility
  981. DISTRIB_DESCRIPTION=$(lsb_release -s -d)
  982. fi
  983. printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
  984. - warning: |
  985. #!/bin/sh
  986. printf "This is [company name] network.\n"
  987. printf "Unauthorized access strictly prohibited.\n"
  988. Services
  989. ~~~~~~~~
  990. Stop and disable the ``linux`` service:
  991. .. code-block:: yaml
  992. linux:
  993. system:
  994. service:
  995. apt-daily.timer:
  996. status: dead
  997. Possible statuses are ``dead`` (disable service by default), ``running``
  998. (enable service by default), ``enabled``, ``disabled``:
  999. Linux with the ``atop`` service:
  1000. .. code-block:: yaml
  1001. linux:
  1002. system:
  1003. atop:
  1004. enabled: true
  1005. interval: 20
  1006. logpath: "/var/log/atop"
  1007. outfile: "/var/log/atop/daily.log"
  1008. Linux with the ``mcelog`` service:
  1009. .. code-block:: yaml
  1010. linux:
  1011. system:
  1012. mcelog:
  1013. enabled: true
  1014. logging:
  1015. syslog: true
  1016. syslog_error: true
  1017. RHEL / CentOS
  1018. ^^^^^^^^^^^^^
  1019. Currently, ``update-motd`` is not available
  1020. for RHEL. So there is no native support for dynamic ``motd``.
  1021. You can still set a static one, with a different pillar structure:
  1022. .. code-block:: yaml
  1023. linux:
  1024. system:
  1025. motd: |
  1026. This is [company name] network.
  1027. Unauthorized access strictly prohibited.
  1028. Haveged
  1029. ~~~~~~~
  1030. If you are running headless server and are low on entropy,
  1031. you may set up Haveged:
  1032. .. code-block:: yaml
  1033. linux:
  1034. system:
  1035. haveged:
  1036. enabled: true
  1037. Linux network
  1038. -------------
  1039. Linux with network manager:
  1040. .. code-block:: yaml
  1041. linux:
  1042. network:
  1043. enabled: true
  1044. network_manager: true
  1045. Execute linux.network.interface state without ifupdown activity:
  1046. .. code-block:: bash
  1047. salt-call linux.network.interface pillar='{"linux":{"network":{"noifupdown":True}}}'
  1048. Linux with default static network interfaces, default gateway
  1049. interface and DNS servers:
  1050. .. code-block:: yaml
  1051. linux:
  1052. network:
  1053. enabled: true
  1054. interface:
  1055. eth0:
  1056. enabled: true
  1057. type: eth
  1058. address: 192.168.0.102
  1059. netmask: 255.255.255.0
  1060. gateway: 192.168.0.1
  1061. name_servers:
  1062. - 8.8.8.8
  1063. - 8.8.4.4
  1064. mtu: 1500
  1065. Linux with bonded interfaces and disabled ``NetworkManager``:
  1066. .. code-block:: yaml
  1067. linux:
  1068. network:
  1069. enabled: true
  1070. interface:
  1071. eth0:
  1072. type: eth
  1073. ...
  1074. eth1:
  1075. type: eth
  1076. ...
  1077. bond0:
  1078. enabled: true
  1079. type: bond
  1080. address: 192.168.0.102
  1081. netmask: 255.255.255.0
  1082. mtu: 1500
  1083. use_in:
  1084. - interface: ${linux:interface:eth0}
  1085. - interface: ${linux:interface:eth0}
  1086. network_manager:
  1087. disable: true
  1088. Linux with VLAN ``interface_params``:
  1089. .. code-block:: yaml
  1090. linux:
  1091. network:
  1092. enabled: true
  1093. interface:
  1094. vlan69:
  1095. type: vlan
  1096. use_interfaces:
  1097. - interface: ${linux:interface:bond0}
  1098. Linux with wireless interface parameters:
  1099. .. code-block:: yaml
  1100. linux:
  1101. network:
  1102. enabled: true
  1103. gateway: 10.0.0.1
  1104. default_interface: eth0
  1105. interface:
  1106. wlan0:
  1107. type: eth
  1108. wireless:
  1109. essid: example
  1110. key: example_key
  1111. security: wpa
  1112. priority: 1
  1113. Linux networks with routes defined:
  1114. .. code-block:: yaml
  1115. linux:
  1116. network:
  1117. enabled: true
  1118. gateway: 10.0.0.1
  1119. default_interface: eth0
  1120. interface:
  1121. eth0:
  1122. type: eth
  1123. route:
  1124. default:
  1125. address: 192.168.0.123
  1126. netmask: 255.255.255.0
  1127. gateway: 192.168.0.1
  1128. Native Linux Bridges:
  1129. .. code-block:: yaml
  1130. linux:
  1131. network:
  1132. interface:
  1133. eth1:
  1134. enabled: true
  1135. type: eth
  1136. proto: manual
  1137. up_cmds:
  1138. - ip address add 0/0 dev $IFACE
  1139. - ip link set $IFACE up
  1140. down_cmds:
  1141. - ip link set $IFACE down
  1142. br-ex:
  1143. enabled: true
  1144. type: bridge
  1145. address: ${linux:network:host:public_local:address}
  1146. netmask: 255.255.255.0
  1147. use_interfaces:
  1148. - eth1
  1149. Open vSwitch Bridges:
  1150. .. code-block:: yaml
  1151. linux:
  1152. network:
  1153. bridge: openvswitch
  1154. interface:
  1155. eth1:
  1156. enabled: true
  1157. type: eth
  1158. proto: manual
  1159. up_cmds:
  1160. - ip address add 0/0 dev $IFACE
  1161. - ip link set $IFACE up
  1162. down_cmds:
  1163. - ip link set $IFACE down
  1164. br-ex:
  1165. enabled: true
  1166. type: bridge
  1167. address: ${linux:network:host:public_local:address}
  1168. netmask: 255.255.255.0
  1169. use_interfaces:
  1170. - eth1
  1171. br-prv:
  1172. enabled: true
  1173. type: ovs_bridge
  1174. mtu: 65000
  1175. br-ens7:
  1176. enabled: true
  1177. name: br-ens7
  1178. type: ovs_bridge
  1179. proto: manual
  1180. mtu: 9000
  1181. use_interfaces:
  1182. - ens7
  1183. patch-br-ens7-br-prv:
  1184. enabled: true
  1185. name: ens7-prv
  1186. ovs_type: ovs_port
  1187. type: ovs_port
  1188. bridge: br-ens7
  1189. port_type: patch
  1190. peer: prv-ens7
  1191. tag: 109 # [] to unset a tag
  1192. mtu: 65000
  1193. patch-br-prv-br-ens7:
  1194. enabled: true
  1195. name: prv-ens7
  1196. bridge: br-prv
  1197. ovs_type: ovs_port
  1198. type: ovs_port
  1199. port_type: patch
  1200. peer: ens7-prv
  1201. tag: 109
  1202. mtu: 65000
  1203. ens7:
  1204. enabled: true
  1205. name: ens7
  1206. proto: manual
  1207. ovs_port_type: OVSPort
  1208. type: ovs_port
  1209. ovs_bridge: br-ens7
  1210. bridge: br-ens7
  1211. Debian manual proto interfaces
  1212. When you are changing interface proto from static in up state
  1213. to manual, you may need to flush ip addresses. For example,
  1214. if you want to use the interface and the ip on the bridge.
  1215. This can be done by setting the ``ipflush_onchange`` to true.
  1216. .. code-block:: yaml
  1217. linux:
  1218. network:
  1219. interface:
  1220. eth1:
  1221. enabled: true
  1222. type: eth
  1223. proto: manual
  1224. mtu: 9100
  1225. ipflush_onchange: true
  1226. Debian static proto interfaces
  1227. When you are changing interface proto from dhcp in up state to
  1228. static, you may need to flush ip addresses and restart interface
  1229. to assign ip address from a managed file. For example, if you wantto
  1230. use the interface and the ip on the bridge. This can be done by
  1231. setting the ``ipflush_onchange`` with combination ``restart_on_ipflush``
  1232. param set to true.
  1233. .. code-block:: yaml
  1234. linux:
  1235. network:
  1236. interface:
  1237. eth1:
  1238. enabled: true
  1239. type: eth
  1240. proto: static
  1241. address: 10.1.0.22
  1242. netmask: 255.255.255.0
  1243. ipflush_onchange: true
  1244. restart_on_ipflush: true
  1245. Concatinating and removing interface files
  1246. Debian based distributions have ``/etc/network/interfaces.d/``
  1247. directory, where you can store configuration of network
  1248. interfaces in separate files. You can concatinate the files
  1249. to the defined destination when needed, this operation removes
  1250. the file from the ``/etc/network/interfaces.d/``. If you just need
  1251. to remove iface files, you can use the ``remove_iface_files`` key.
  1252. .. code-block:: yaml
  1253. linux:
  1254. network:
  1255. concat_iface_files:
  1256. - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
  1257. dst: '/etc/network/interfaces'
  1258. remove_iface_files:
  1259. - '/etc/network/interfaces.d/90-custom.cfg'
  1260. Configure DHCP client
  1261. None of the keys is mandatory, include only those you really need.
  1262. For full list of available options under send, supersede, prepend,
  1263. append refer to dhcp-options(5).
  1264. .. code-block:: yaml
  1265. linux:
  1266. network:
  1267. dhclient:
  1268. enabled: true
  1269. backoff_cutoff: 15
  1270. initial_interval: 10
  1271. reboot: 10
  1272. retry: 60
  1273. select_timeout: 0
  1274. timeout: 120
  1275. send:
  1276. - option: host-name
  1277. declaration: "= gethostname()"
  1278. supersede:
  1279. - option: host-name
  1280. declaration: "spaceship"
  1281. - option: domain-name
  1282. declaration: "domain.home"
  1283. #- option: arp-cache-timeout
  1284. # declaration: 20
  1285. prepend:
  1286. - option: domain-name-servers
  1287. declaration:
  1288. - 8.8.8.8
  1289. - 8.8.4.4
  1290. - option: domain-search
  1291. declaration:
  1292. - example.com
  1293. - eng.example.com
  1294. #append:
  1295. #- option: domain-name-servers
  1296. # declaration: 127.0.0.1
  1297. # ip or subnet to reject dhcp offer from
  1298. reject:
  1299. - 192.33.137.209
  1300. - 10.0.2.0/24
  1301. request:
  1302. - subnet-mask
  1303. - broadcast-address
  1304. - time-offset
  1305. - routers
  1306. - domain-name
  1307. - domain-name-servers
  1308. - domain-search
  1309. - host-name
  1310. - dhcp6.name-servers
  1311. - dhcp6.domain-search
  1312. - dhcp6.fqdn
  1313. - dhcp6.sntp-servers
  1314. - netbios-name-servers
  1315. - netbios-scope
  1316. - interface-mtu
  1317. - rfc3442-classless-static-routes
  1318. - ntp-servers
  1319. require:
  1320. - subnet-mask
  1321. - domain-name-servers
  1322. # if per interface configuration required add below
  1323. interface:
  1324. ens2:
  1325. initial_interval: 11
  1326. reject:
  1327. - 192.33.137.210
  1328. ens3:
  1329. initial_interval: 12
  1330. reject:
  1331. - 192.33.137.211
  1332. Linux network systemd settings:
  1333. .. code-block:: yaml
  1334. linux:
  1335. network:
  1336. ...
  1337. systemd:
  1338. link:
  1339. 10-iface-dmz:
  1340. Match:
  1341. MACAddress: c8:5b:67:fa:1a:af
  1342. OriginalName: eth0
  1343. Link:
  1344. Name: dmz0
  1345. netdev:
  1346. 20-bridge-dmz:
  1347. match:
  1348. name: dmz0
  1349. network:
  1350. mescription: bridge
  1351. bridge: br-dmz0
  1352. network:
  1353. # works with lowercase, keys are by default capitalized
  1354. 40-dhcp:
  1355. match:
  1356. name: '*'
  1357. network:
  1358. DHCP: yes
  1359. Configure global environment variables
  1360. Use ``/etc/environment`` for static system wide variable assignment
  1361. after boot. Variable expansion is frequently not supported.
  1362. .. code-block:: yaml
  1363. linux:
  1364. system:
  1365. env:
  1366. BOB_VARIABLE: Alice
  1367. ...
  1368. BOB_PATH:
  1369. - /srv/alice/bin
  1370. - /srv/bob/bin
  1371. ...
  1372. ftp_proxy: none
  1373. http_proxy: http://global-http-proxy.host.local:8080
  1374. https_proxy: ${linux:system:proxy:https}
  1375. no_proxy:
  1376. - 192.168.0.80
  1377. - 192.168.1.80
  1378. - .domain.com
  1379. - .local
  1380. ...
  1381. # NOTE: global defaults proxy configuration.
  1382. proxy:
  1383. ftp: ftp://proxy.host.local:2121
  1384. http: http://proxy.host.local:3142
  1385. https: https://proxy.host.local:3143
  1386. noproxy:
  1387. - .domain.com
  1388. - .local
  1389. Configure the ``profile.d`` scripts
  1390. The ``profile.d`` scripts are being sourced during ``.sh`` execution
  1391. and support variable expansion in opposite to /etc/environment global
  1392. settings in ``/etc/environment``.
  1393. .. code-block:: yaml
  1394. linux:
  1395. system:
  1396. profile:
  1397. locales: |
  1398. export LANG=C
  1399. export LC_ALL=C
  1400. ...
  1401. vi_flavors.sh: |
  1402. export PAGER=view
  1403. export EDITOR=vim
  1404. alias vi=vim
  1405. shell_locales.sh: |
  1406. export LANG=en_US
  1407. export LC_ALL=en_US.UTF-8
  1408. shell_proxies.sh: |
  1409. export FTP_PROXY=ftp://127.0.3.3:2121
  1410. export NO_PROXY='.local'
  1411. Configure login.defs parameters
  1412. -------------------------------
  1413. .. code-block:: yaml
  1414. linux:
  1415. system:
  1416. login_defs:
  1417. <opt_name>:
  1418. enabled: true
  1419. value: <opt_value>
  1420. <opt_name> is a configurational option defined in 'man login.defs'.
  1421. <opt_name> is case sensitive, should be UPPERCASE only!
  1422. Linux with hosts
  1423. Parameter ``purge_hosts`` will enforce whole ``/etc/hosts file``,
  1424. removing entries that are not defined in model except defaults
  1425. for both IPv4 and IPv6 localhost and hostname as well as FQDN.
  1426. We recommend using this option to verify that ``/etc/hosts``
  1427. is always in a clean state. However it is not enabled by default
  1428. for security reasons.
  1429. .. code-block:: yaml
  1430. linux:
  1431. network:
  1432. purge_hosts: true
  1433. host:
  1434. # No need to define this one if purge_hosts is true
  1435. hostname:
  1436. address: 127.0.1.1
  1437. names:
  1438. - ${linux:network:fqdn}
  1439. - ${linux:network:hostname}
  1440. node1:
  1441. address: 192.168.10.200
  1442. names:
  1443. - node2.domain.com
  1444. - service2.domain.com
  1445. node2:
  1446. address: 192.168.10.201
  1447. names:
  1448. - node2.domain.com
  1449. - service2.domain.com
  1450. Linux with hosts collected from mine
  1451. All DNS records defined within infrastrucuture
  1452. are passed to the local hosts records or any DNS server. Only
  1453. hosts with the ``grain`` parameter set to ``true`` will be propagated
  1454. to the mine.
  1455. .. code-block:: yaml
  1456. linux:
  1457. network:
  1458. purge_hosts: true
  1459. mine_dns_records: true
  1460. host:
  1461. node1:
  1462. address: 192.168.10.200
  1463. grain: true
  1464. names:
  1465. - node2.domain.com
  1466. - service2.domain.com
  1467. Set up ``resolv.conf``, nameservers, domain and search domains:
  1468. .. code-block:: yaml
  1469. linux:
  1470. network:
  1471. resolv:
  1472. dns:
  1473. - 8.8.4.4
  1474. - 8.8.8.8
  1475. domain: my.example.com
  1476. search:
  1477. - my.example.com
  1478. - example.com
  1479. options:
  1480. - ndots: 5
  1481. - timeout: 2
  1482. - attempts: 2
  1483. Set up custom TX queue length for tap interfaces:
  1484. .. code-block:: yaml
  1485. linux:
  1486. network:
  1487. tap_custom_txqueuelen: 10000
  1488. Open vSwitch native bond:
  1489. .. code-block:: yaml
  1490. bond1:
  1491. enabled: true
  1492. type: ovs_bond
  1493. mode: balance-slb
  1494. bridge: br-ex
  1495. slaves: eno3 eno4
  1496. DPDK OVS interfaces
  1497. **DPDK OVS NIC**
  1498. .. code-block:: yaml
  1499. linux:
  1500. network:
  1501. bridge: openvswitch
  1502. dpdk:
  1503. enabled: true
  1504. driver: uio/vfio
  1505. openvswitch:
  1506. pmd_cpu_mask: "0x6"
  1507. dpdk_socket_mem: "1024,1024"
  1508. dpdk_lcore_mask: "0x400"
  1509. memory_channels: 2
  1510. interface:
  1511. dpkd0:
  1512. name: ${_param:dpdk_nic}
  1513. pci: 0000:06:00.0
  1514. driver: igb_uio/vfio-pci
  1515. enabled: true
  1516. type: dpdk_ovs_port
  1517. n_rxq: 2
  1518. pmd_rxq_affinity: "0:1,1:2"
  1519. bridge: br-prv
  1520. mtu: 9000
  1521. br-prv:
  1522. enabled: true
  1523. type: dpdk_ovs_bridge
  1524. **DPDK OVS Bond**
  1525. .. code-block:: yaml
  1526. linux:
  1527. network:
  1528. bridge: openvswitch
  1529. dpdk:
  1530. enabled: true
  1531. driver: uio/vfio
  1532. openvswitch:
  1533. pmd_cpu_mask: "0x6"
  1534. dpdk_socket_mem: "1024,1024"
  1535. dpdk_lcore_mask: "0x400"
  1536. memory_channels: 2
  1537. interface:
  1538. dpdk_second_nic:
  1539. name: ${_param:primary_second_nic}
  1540. pci: 0000:06:00.0
  1541. driver: igb_uio/vfio-pci
  1542. bond: dpdkbond0
  1543. enabled: true
  1544. type: dpdk_ovs_port
  1545. n_rxq: 2
  1546. pmd_rxq_affinity: "0:1,1:2"
  1547. mtu: 9000
  1548. dpdk_first_nic:
  1549. name: ${_param:primary_first_nic}
  1550. pci: 0000:05:00.0
  1551. driver: igb_uio/vfio-pci
  1552. bond: dpdkbond0
  1553. enabled: true
  1554. type: dpdk_ovs_port
  1555. n_rxq: 2
  1556. pmd_rxq_affinity: "0:1,1:2"
  1557. mtu: 9000
  1558. dpdkbond0:
  1559. enabled: true
  1560. bridge: br-prv
  1561. type: dpdk_ovs_bond
  1562. mode: active-backup
  1563. br-prv:
  1564. enabled: true
  1565. type: dpdk_ovs_bridge
  1566. **DPDK OVS LACP Bond with vlan tag**
  1567. .. code-block:: yaml
  1568. linux:
  1569. network:
  1570. bridge: openvswitch
  1571. dpdk:
  1572. enabled: true
  1573. driver: uio
  1574. openvswitch:
  1575. pmd_cpu_mask: "0x6"
  1576. dpdk_socket_mem: "1024,1024"
  1577. dpdk_lcore_mask: "0x400"
  1578. memory_channels: "2"
  1579. interface:
  1580. eth3:
  1581. enabled: true
  1582. type: eth
  1583. proto: manual
  1584. name: ${_param:tenant_first_nic}
  1585. eth4:
  1586. enabled: true
  1587. type: eth
  1588. proto: manual
  1589. name: ${_param:tenant_second_nic}
  1590. dpdk0:
  1591. name: ${_param:tenant_first_nic}
  1592. pci: "0000:81:00.0"
  1593. driver: igb_uio
  1594. bond: bond1
  1595. enabled: true
  1596. type: dpdk_ovs_port
  1597. n_rxq: 2
  1598. dpdk1:
  1599. name: ${_param:tenant_second_nic}
  1600. pci: "0000:81:00.1"
  1601. driver: igb_uio
  1602. bond: bond1
  1603. enabled: true
  1604. type: dpdk_ovs_port
  1605. n_rxq: 2
  1606. bond1:
  1607. enabled: true
  1608. bridge: br-prv
  1609. type: dpdk_ovs_bond
  1610. mode: balance-slb
  1611. br-prv:
  1612. enabled: true
  1613. type: dpdk_ovs_bridge
  1614. tag: ${_param:tenant_vlan}
  1615. address: ${_param:tenant_address}
  1616. netmask: ${_param:tenant_network_netmask}
  1617. **DPDK OVS bridge for VXLAN**
  1618. If VXLAN is used as tenant segmentation, IP address must
  1619. be set on ``br-prv``.
  1620. .. code-block:: yaml
  1621. linux:
  1622. network:
  1623. ...
  1624. interface:
  1625. br-prv:
  1626. enabled: true
  1627. type: dpdk_ovs_bridge
  1628. address: 192.168.50.0
  1629. netmask: 255.255.255.0
  1630. tag: 101
  1631. mtu: 9000
  1632. **DPDK OVS bridge with Linux network interface**
  1633. .. code-block:: yaml
  1634. linux:
  1635. network:
  1636. ...
  1637. interface:
  1638. eth0:
  1639. type: eth
  1640. ovs_bridge: br-prv
  1641. ...
  1642. br-prv:
  1643. enabled: true
  1644. type: dpdk_ovs_bridge
  1645. ...
  1646. Linux storage
  1647. -------------
  1648. Linux with mounted Samba:
  1649. .. code-block:: yaml
  1650. linux:
  1651. storage:
  1652. enabled: true
  1653. mount:
  1654. samba1:
  1655. - enabled: true
  1656. - path: /media/myuser/public/
  1657. - device: //192.168.0.1/storage
  1658. - file_system: cifs
  1659. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  1660. NFS mount:
  1661. .. code-block:: yaml
  1662. linux:
  1663. storage:
  1664. enabled: true
  1665. mount:
  1666. nfs_glance:
  1667. enabled: true
  1668. path: /var/lib/glance/images
  1669. device: 172.16.10.110:/var/nfs/glance
  1670. file_system: nfs
  1671. opts: rw,sync
  1672. File swap configuration:
  1673. .. code-block:: yaml
  1674. linux:
  1675. storage:
  1676. enabled: true
  1677. swap:
  1678. file:
  1679. enabled: true
  1680. engine: file
  1681. device: /swapfile
  1682. size: 1024
  1683. Partition swap configuration:
  1684. .. code-block:: yaml
  1685. linux:
  1686. storage:
  1687. enabled: true
  1688. swap:
  1689. partition:
  1690. enabled: true
  1691. engine: partition
  1692. device: /dev/vg0/swap
  1693. LVM group ``vg1`` with one device and ``data`` volume mounted
  1694. into ``/mnt/data``.
  1695. .. code-block:: yaml
  1696. parameters:
  1697. linux:
  1698. storage:
  1699. mount:
  1700. data:
  1701. enabled: true
  1702. device: /dev/vg1/data
  1703. file_system: ext4
  1704. path: /mnt/data
  1705. lvm:
  1706. vg1:
  1707. enabled: true
  1708. devices:
  1709. - /dev/sdb
  1710. volume:
  1711. data:
  1712. size: 40G
  1713. mount: ${linux:storage:mount:data}
  1714. Create partitions on disk. Specify size in MB. It expects empty
  1715. disk without any existing partitions.
  1716. Set ``startsector=1`` if you want to start partitions from ``2048``.
  1717. .. code-block:: yaml
  1718. linux:
  1719. storage:
  1720. disk:
  1721. first_drive:
  1722. startsector: 1
  1723. name: /dev/loop1
  1724. type: gpt
  1725. partitions:
  1726. - size: 200 #size in MB
  1727. type: fat32
  1728. - size: 300 #size in MB
  1729. mkfs: True
  1730. type: xfs
  1731. /dev/vda1:
  1732. partitions:
  1733. - size: 5
  1734. type: ext2
  1735. - size: 10
  1736. type: ext4
  1737. Multipath with Fujitsu Eternus DXL:
  1738. .. code-block:: yaml
  1739. parameters:
  1740. linux:
  1741. storage:
  1742. multipath:
  1743. enabled: true
  1744. blacklist_devices:
  1745. - /dev/sda
  1746. - /dev/sdb
  1747. backends:
  1748. - fujitsu_eternus_dxl
  1749. Multipath with Hitachi VSP 1000:
  1750. .. code-block:: yaml
  1751. parameters:
  1752. linux:
  1753. storage:
  1754. multipath:
  1755. enabled: true
  1756. blacklist_devices:
  1757. - /dev/sda
  1758. - /dev/sdb
  1759. backends:
  1760. - hitachi_vsp1000
  1761. Multipath with IBM Storwize:
  1762. .. code-block:: yaml
  1763. parameters:
  1764. linux:
  1765. storage:
  1766. multipath:
  1767. enabled: true
  1768. blacklist_devices:
  1769. - /dev/sda
  1770. - /dev/sdb
  1771. backends:
  1772. - ibm_storwize
  1773. Multipath with multiple backends:
  1774. .. code-block:: yaml
  1775. parameters:
  1776. linux:
  1777. storage:
  1778. multipath:
  1779. enabled: true
  1780. blacklist_devices:
  1781. - /dev/sda
  1782. - /dev/sdb
  1783. - /dev/sdc
  1784. - /dev/sdd
  1785. backends:
  1786. - ibm_storwize
  1787. - fujitsu_eternus_dxl
  1788. - hitachi_vsp1000
  1789. PAM LDAP integration:
  1790. .. code-block:: yaml
  1791. parameters:
  1792. linux:
  1793. system:
  1794. auth:
  1795. enabled: true
  1796. mkhomedir:
  1797. enabled: true
  1798. umask: 0027
  1799. ldap:
  1800. enabled: true
  1801. binddn: cn=bind,ou=service_users,dc=example,dc=com
  1802. bindpw: secret
  1803. uri: ldap://127.0.0.1
  1804. base: ou=users,dc=example,dc=com
  1805. ldap_version: 3
  1806. pagesize: 65536
  1807. referrals: off
  1808. filter:
  1809. passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1810. shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
  1811. group: (&(objectClass=group)(gidNumber=*))
  1812. PAM duo 2FA integration
  1813. .. code-block:: yaml
  1814. parameters:
  1815. linux:
  1816. system:
  1817. auth:
  1818. enabled: true
  1819. duo:
  1820. enabled: true
  1821. duo_host: localhost
  1822. duo_ikey: DUO-INTEGRATION-KEY
  1823. duo_skey: DUO-SECRET-KEY
  1824. duo package version may be specified (optional)
  1825. .. code-block:: yaml
  1826. linux:
  1827. system:
  1828. package:
  1829. duo-unix:
  1830. version: 1.10.1-0
  1831. Disabled multipath (the default setup):
  1832. .. code-block:: yaml
  1833. parameters:
  1834. linux:
  1835. storage:
  1836. multipath:
  1837. enabled: false
  1838. Linux with local loopback device:
  1839. .. code-block:: yaml
  1840. linux:
  1841. storage:
  1842. loopback:
  1843. disk1:
  1844. file: /srv/disk1
  1845. size: 50G
  1846. External config generation
  1847. --------------------------
  1848. You are able to use config support metadata between formulas
  1849. and only generate configuration files for external use, for example, Docker, and so on.
  1850. .. code-block:: yaml
  1851. parameters:
  1852. linux:
  1853. system:
  1854. config:
  1855. pillar:
  1856. jenkins:
  1857. master:
  1858. home: /srv/volumes/jenkins
  1859. approved_scripts:
  1860. - method java.net.URL openConnection
  1861. credentials:
  1862. - type: username_password
  1863. scope: global
  1864. id: test
  1865. desc: Testing credentials
  1866. username: test
  1867. password: test
  1868. Netconsole Remote Kernel Logging
  1869. --------------------------------
  1870. Netconsole logger can be configured for the configfs-enabled kernels
  1871. (``CONFIG_NETCONSOLE_DYNAMIC`` must be enabled). The configuration
  1872. applies both in runtime (if network is already configured),
  1873. and on-boot after an interface initialization.
  1874. .. note::
  1875. * Receiver can be located only on the same L3 domain
  1876. (or you need to configure gateway MAC manually).
  1877. * The Receiver MAC is detected only on configuration time.
  1878. * Using broadcast MAC is not recommended.
  1879. .. code-block:: yaml
  1880. parameters:
  1881. linux:
  1882. system:
  1883. netconsole:
  1884. enabled: true
  1885. port: 514 (optional)
  1886. loglevel: debug (optional)
  1887. target:
  1888. 192.168.0.1:
  1889. interface: bond0
  1890. mac: "ff:ff:ff:ff:ff:ff" (optional)
  1891. Check network params on the environment
  1892. ---------------------------------------
  1893. Grab nics and nics states
  1894. .. code-block:: bash
  1895. salt osd001\* net_checks.get_nics
  1896. **Example of system output:**
  1897. .. code-block:: bash
  1898. osd001.domain.com:
  1899. |_
  1900. - bond0
  1901. - None
  1902. - 1e:c8:64:42:23:b9
  1903. - 0
  1904. - 1500
  1905. |_
  1906. - bond1
  1907. - None
  1908. - 3c:fd:fe:27:3b:00
  1909. - 1
  1910. - 9100
  1911. |_
  1912. - fourty1
  1913. - None
  1914. - 3c:fd:fe:27:3b:00
  1915. - 1
  1916. - 9100
  1917. |_
  1918. - fourty2
  1919. - None
  1920. - 3c:fd:fe:27:3b:02
  1921. - 1
  1922. - 9100
  1923. Grab 10G nics PCI addresses for hugepages setup
  1924. .. code-block:: bash
  1925. salt cmp001\* net_checks.get_ten_pci
  1926. **Example of system output:**
  1927. .. code-block:: bash
  1928. cmp001.domain.com:
  1929. |_
  1930. - ten1
  1931. - 0000:19:00.0
  1932. |_
  1933. - ten2
  1934. - 0000:19:00.1
  1935. |_
  1936. - ten3
  1937. - 0000:19:00.2
  1938. |_
  1939. - ten4
  1940. - 0000:19:00.3
  1941. Grab ip address for an interface
  1942. .. code-block:: bash
  1943. salt cmp001\* net_checks.get_ip iface=one4
  1944. **Example of system output:**
  1945. .. code-block:: bash
  1946. cmp001.domain.com:
  1947. 10.200.177.101
  1948. Grab ip addresses map
  1949. .. code-block:: bash
  1950. salt-call net_checks.nodes_addresses
  1951. **Example of system output:**
  1952. .. code-block:: bash
  1953. local:
  1954. |_
  1955. - cid01.domain.com
  1956. |_
  1957. |_
  1958. - pxe
  1959. - 10.200.177.91
  1960. |_
  1961. - control
  1962. - 10.200.178.91
  1963. |_
  1964. - cmn02.domain.com
  1965. |_
  1966. |_
  1967. - storage_access
  1968. - 10.200.181.67
  1969. |_
  1970. - pxe
  1971. - 10.200.177.67
  1972. |_
  1973. - control
  1974. - 10.200.178.67
  1975. |_
  1976. - cmp010.domain.com
  1977. |_
  1978. |_
  1979. - pxe
  1980. - 10.200.177.110
  1981. |_
  1982. - storage_access
  1983. - 10.200.181.110
  1984. |_
  1985. - control
  1986. - 10.200.178.110
  1987. |_
  1988. - vxlan
  1989. - 10.200.179.110
  1990. Verify full mesh connectivity
  1991. .. code-block:: bash
  1992. salt-call net_checks.ping_check
  1993. **Example of positive system output:**
  1994. .. code-block:: bash
  1995. ['PASSED']
  1996. [INFO ] ['PASSED']
  1997. local:
  1998. True
  1999. **Example of system output in case of failure:**
  2000. .. code-block:: bash
  2001. FAILED
  2002. [ERROR ] FAILED
  2003. ['control: 10.0.1.92 -> 10.0.1.224: Failed']
  2004. ['control: 10.0.1.93 -> 10.0.1.224: Failed']
  2005. ['control: 10.0.1.51 -> 10.0.1.224: Failed']
  2006. ['control: 10.0.1.102 -> 10.0.1.224: Failed']
  2007. ['control: 10.0.1.13 -> 10.0.1.224: Failed']
  2008. ['control: 10.0.1.81 -> 10.0.1.224: Failed']
  2009. local:
  2010. False
  2011. For this feature to work, please mark addresses with some role.
  2012. Otherwise 'default' role is assumed and mesh would consist of all
  2013. addresses on the environment.
  2014. Mesh mark is needed only for interfaces which are enabled and have
  2015. ip address assigned.
  2016. Checking dhcp pxe network meaningless, as it is used for salt
  2017. master vs minion communications, therefore treated as checked.
  2018. .. code-block:: yaml
  2019. parameters:
  2020. linux:
  2021. network:
  2022. interface:
  2023. ens3:
  2024. enabled: true
  2025. type: eth
  2026. proto: static
  2027. address: ${_param:deploy_address}
  2028. netmask: ${_param:deploy_network_netmask}
  2029. gateway: ${_param:deploy_network_gateway}
  2030. mesh: pxe
  2031. Check pillars for ip address duplicates
  2032. .. code-block:: bash
  2033. salt-call net_checks.verify_addresses
  2034. **Example of positive system output:**
  2035. .. code-block:: bash
  2036. ['PASSED']
  2037. [INFO ] ['PASSED']
  2038. local:
  2039. True
  2040. **Example of system output in case of failure:**
  2041. .. code-block:: bash
  2042. FAILED. Duplicates found
  2043. [ERROR ] FAILED. Duplicates found
  2044. ['gtw01.domain.com', 'gtw02.domain.com', '10.0.1.224']
  2045. [ERROR ] ['gtw01.domain.com', 'gtw02.domain.com', '10.0.1.224']
  2046. local:
  2047. False
  2048. Generate csv report for the env
  2049. .. code-block:: bash
  2050. salt -C 'kvm* or cmp* or osd*' net_checks.get_nics_csv \
  2051. | grep '^\ ' | sed 's/\ *//g' | grep -Ev ^server \
  2052. | sed '1 i\server,nic_name,ip_addr,mac_addr,link,mtu,chassis_id,chassis_name,port_mac,port_descr'
  2053. **Example of system output:**
  2054. .. code-block:: bash
  2055. server,nic_name,ip_addr,mac_addr,link,mtu,chassis_id,chassis_name,port_mac,port_descr
  2056. cmp010.domain.com,bond0,None,b4:96:91:10:5b:3a,1,1500,,,,
  2057. cmp010.domain.com,bond0.21,10.200.178.110,b4:96:91:10:5b:3a,1,1500,,,,
  2058. cmp010.domain.com,bond0.22,10.200.179.110,b4:96:91:10:5b:3a,1,1500,,,,
  2059. cmp010.domain.com,bond1,None,3c:fd:fe:34:ad:22,0,1500,,,,
  2060. cmp010.domain.com,bond1.24,10.200.181.110,3c:fd:fe:34:ad:22,0,1500,,,,
  2061. cmp010.domain.com,fourty5,None,3c:fd:fe:34:ad:20,0,9000,,,,
  2062. cmp010.domain.com,fourty6,None,3c:fd:fe:34:ad:22,0,9000,,,,
  2063. cmp010.domain.com,one1,None,b4:96:91:10:5b:38,0,1500,,,,
  2064. 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
  2065. 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
  2066. 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
  2067. cmp011.domain.com,bond0,None,b4:96:91:13:6c:aa,1,1500,,,,
  2068. cmp011.domain.com,bond0.21,10.200.178.111,b4:96:91:13:6c:aa,1,1500,,,,
  2069. cmp011.domain.com,bond0.22,10.200.179.111,b4:96:91:13:6c:aa,1,1500,,,,
  2070. ...
  2071. Usage
  2072. =====
  2073. Set MTU of the eth0 network interface to 1400:
  2074. .. code-block:: bash
  2075. ip link set dev eth0 mtu 1400
  2076. Read more
  2077. =========
  2078. * https://www.archlinux.org/
  2079. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
  2080. Documentation and Bugs
  2081. ======================
  2082. * http://salt-formulas.readthedocs.io/
  2083. Learn how to install and update salt-formulas.
  2084. * https://github.com/salt-formulas/salt-formula-linux/issues
  2085. In the unfortunate event that bugs are discovered, report the issue to the
  2086. appropriate issue tracker. Use the Github issue tracker for a specific salt
  2087. formula.
  2088. * https://launchpad.net/salt-formulas
  2089. For feature requests, bug reports, or blueprints affecting the entire
  2090. ecosystem, use the Launchpad salt-formulas project.
  2091. * https://launchpad.net/~salt-formulas-users
  2092. Join the salt-formulas-users team and subscribe to mailing list if required.
  2093. * https://github.com/salt-formulas/salt-formula-linux
  2094. Develop the salt-formulas projects in the master branch and then submit pull
  2095. requests against a specific formula.
  2096. * #salt-formulas @ irc.freenode.net
  2097. Use this IRC channel in case of any questions or feedback which is always
  2098. welcome.