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.

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