* Update file.sls add replace * Update file.sls update replace * Update job.sls Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign. https://docs.saltstack.com/en/master/ref/states/all/salt.states.cron.html * Update README.rst Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign. * Update README.rst * fix(deprecation): update to new method (#214) Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com> * Allow swap to be completely disabled * sort repos so they do not change order every run * allow use of new state syntax for module.run The new syntax has been supported since ~2017. From the docs, in case they change: ! New Style test.random_hash: module.run: - test.random_hash: - size: 42 - hash_type: sha256 ! Legacy Style test.random_hash: module.run: - size: 42 - hash_type: sha256 * Update map.jinja Add support fpr Ubuntu Focal. * Update file.sls added possibility to delete files * Network resolf.conf handling the handling as the Resolv.conf is generated and adapted, adapted. previously the Resolv.conf was created and then through Overwrite "network.system" in the interface.sls again. With two search servers that should actually be included. "search example.com. sudomain.example.com" but it always became that search ['example.com.', 'sudomain.example.com'] The resolv.conf was first created correctly but then overwritten again in the interface.sls. The problem only arises if you don't want to have a "Domain:" in resov.conf * rewrite LVM lv_present Since salt now also supports LV extend and reduce, the option Force must be used with care. The changes include that force is only set if the corresponding LV does not yet exist (check via Grains) in order to overwrite any FS signatures (Wiping fs signature). If the LV already exists (check via Grains), Force is set to False unless this is explicitly set to True in the pillars. * Network resolf.conf handling (#220) (#8) * Update file.sls add replace * Update file.sls update replace * Update job.sls Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign. https://docs.saltstack.com/en/master/ref/states/all/salt.states.cron.html * Update README.rst Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign. * Update README.rst * fix(deprecation): update to new method (#214) Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com> * Allow swap to be completely disabled * sort repos so they do not change order every run * allow use of new state syntax for module.run The new syntax has been supported since ~2017. From the docs, in case they change: ! New Style test.random_hash: module.run: - test.random_hash: - size: 42 - hash_type: sha256 ! Legacy Style test.random_hash: module.run: - size: 42 - hash_type: sha256 * Update map.jinja Add support fpr Ubuntu Focal. * Update file.sls added possibility to delete files * Network resolf.conf handling the handling as the Resolv.conf is generated and adapted, adapted. previously the Resolv.conf was created and then through Overwrite "network.system" in the interface.sls again. With two search servers that should actually be included. "search example.com. sudomain.example.com" but it always became that search ['example.com.', 'sudomain.example.com'] The resolv.conf was first created correctly but then overwritten again in the interface.sls. The problem only arises if you don't want to have a "Domain:" in resov.conf Co-authored-by: Felipe Zipitría <fzipi@fing.edu.uy> Co-authored-by: Kyle Gullion <kgullion@gmail.com> Co-authored-by: Matthew Thode <thode@fsi.io> Co-authored-by: Matthew Thode <mthode@mthode.org> Co-authored-by: Felipe Zipitría <fzipi@fing.edu.uy> Co-authored-by: Kyle Gullion <kgullion@gmail.com> Co-authored-by: Matthew Thode <thode@fsi.io> Co-authored-by: Matthew Thode <mthode@mthode.org> * Network resolf.conf handling (#220) (#9) * Update file.sls add replace * Update file.sls update replace * Update job.sls Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign. https://docs.saltstack.com/en/master/ref/states/all/salt.states.cron.html * Update README.rst Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign. * Update README.rst * fix(deprecation): update to new method (#214) Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com> * Allow swap to be completely disabled * sort repos so they do not change order every run * allow use of new state syntax for module.run The new syntax has been supported since ~2017. From the docs, in case they change: ! New Style test.random_hash: module.run: - test.random_hash: - size: 42 - hash_type: sha256 ! Legacy Style test.random_hash: module.run: - size: 42 - hash_type: sha256 * Update map.jinja Add support fpr Ubuntu Focal. * Update file.sls added possibility to delete files * Network resolf.conf handling the handling as the Resolv.conf is generated and adapted, adapted. previously the Resolv.conf was created and then through Overwrite "network.system" in the interface.sls again. With two search servers that should actually be included. "search example.com. sudomain.example.com" but it always became that search ['example.com.', 'sudomain.example.com'] The resolv.conf was first created correctly but then overwritten again in the interface.sls. The problem only arises if you don't want to have a "Domain:" in resov.conf Co-authored-by: Felipe Zipitría <fzipi@fing.edu.uy> Co-authored-by: Kyle Gullion <kgullion@gmail.com> Co-authored-by: Matthew Thode <thode@fsi.io> Co-authored-by: Matthew Thode <mthode@mthode.org> Co-authored-by: Felipe Zipitría <fzipi@fing.edu.uy> Co-authored-by: Kyle Gullion <kgullion@gmail.com> Co-authored-by: Matthew Thode <thode@fsi.io> Co-authored-by: Matthew Thode <mthode@mthode.org> * Update mount.sls added the possibility to set the dump and pass option dump The dump value to be passed into the fstab, Default is 0 pass_num The pass value to be passed into the fstab, Default is 0 * Update mount.sls correction, wrong line. added the possibility to set the dump and pass option dump The dump value to be passed into the fstab, Default is 0 pass_num The pass value to be passed into the fstab, Default is 0 * Add Bind Mount Option Add Bind Mount Option * Add support for template defaults/context args * Add IPv6 Interface Support Add IPv6 Interface Support First Version * Fix warning in salt v3003 The 'gid_from_name' argument in the user.present state has been replaced with 'usergroup'. Update your SLS file to get rid of this warning. * Update map.jinja add Jammy Support --------- Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com> Co-authored-by: Felipe Zipitría <fzipi@fing.edu.uy> Co-authored-by: Kyle Gullion <kgullion@gmail.com> Co-authored-by: Matthew Thode <thode@fsi.io> Co-authored-by: Matthew Thode <mthode@mthode.org> Co-authored-by: Bruno Binet <bruno.binet@gmail.com>pull/234/head
journal: | journal: | ||||
SystemMaxUse: "50M" | SystemMaxUse: "50M" | ||||
RuntimeMaxFiles: "100" | RuntimeMaxFiles: "100" | ||||
Ensure presence of directory: | Ensure presence of directory: | ||||
.. code-block:: yaml | .. code-block:: yaml | ||||
- 8.8.4.4 | - 8.8.4.4 | ||||
mtu: 1500 | mtu: 1500 | ||||
Linux with IPv4 and IPv6 static network interfaces, default gateway | |||||
.. code-block:: yaml | |||||
linux: | |||||
network: | |||||
enabled: true | |||||
interface: | |||||
eth0: | |||||
enabled: true | |||||
type: eth | |||||
address: 192.168.0.102 | |||||
netmask: 255.255.255.0 | |||||
gateway: 192.168.0.1 | |||||
enable_ipv6: true | |||||
ipv6proto: static | |||||
ipv6ipaddr: 1234:abcd::ffff:192.168.0.102 | |||||
ipv6gateway: 1234:abcd::ffff:192.168.0.1 | |||||
ipv6netmask: 64 | |||||
Linux with bonded interfaces and disabled ``NetworkManager``: | Linux with bonded interfaces and disabled ``NetworkManager``: | ||||
.. code-block:: yaml | .. code-block:: yaml | ||||
file_system: nfs | file_system: nfs | ||||
opts: rw,sync | opts: rw,sync | ||||
Bind mount: | |||||
.. code-block:: yaml | |||||
linux: | |||||
storage: | |||||
enabled: true | |||||
mount: | |||||
mount_bind: | |||||
enabled: true | |||||
path: /mnt/bind/name | |||||
device: /mnt/source/bind | |||||
file_system: none | |||||
opts: bind,defaults | |||||
dump: 0 | |||||
pass_num: 1 | |||||
File swap configuration: | File swap configuration: | ||||
.. code-block:: yaml | .. code-block:: yaml | ||||
size: 40G | size: 40G | ||||
mount: ${linux:storage:mount:data} | mount: ${linux:storage:mount:data} | ||||
Salt now also supports expanding and shrinking a LV: | |||||
To reduce the size of an LV the option force must be set to true. | |||||
! Caution this can destroy the file system if it is not shrunk before ! | |||||
only some file systems can be shrunk. | |||||
.. code-block:: yaml | |||||
parameters: | |||||
linux: | |||||
lvm: | |||||
vg1: | |||||
enabled: true | |||||
devices: | |||||
- /dev/sdb | |||||
volume: | |||||
data: # to expand | |||||
size: 50G | |||||
mount: ${linux:storage:mount:data} | |||||
data: # to reduce | |||||
size: 30G | |||||
force: true | |||||
mount: ${linux:storage:mount:data} | |||||
Create partitions on disk. Specify size in MB. It expects empty | Create partitions on disk. Specify size in MB. It expects empty | ||||
disk without any existing partitions. | disk without any existing partitions. | ||||
Set ``startsector=1`` if you want to start partitions from ``2048``. | Set ``startsector=1`` if you want to start partitions from ``2048``. | ||||
* #salt-formulas @ irc.freenode.net | * #salt-formulas @ irc.freenode.net | ||||
Use this IRC channel in case of any questions or feedback which is always | Use this IRC channel in case of any questions or feedback which is always | ||||
welcome. | welcome. | ||||
'CentOS Stream 8': { | 'CentOS Stream 8': { | ||||
'lvm_services': ['lvm2-lvmpolld', 'lvm2-monitor'], | 'lvm_services': ['lvm2-lvmpolld', 'lvm2-monitor'], | ||||
}, | }, | ||||
'jammy': { | |||||
'lvm_services': ['lvm2-monitor'], | |||||
}, | |||||
'focal': { | 'focal': { | ||||
'lvm_services': ['lvm2-monitor'], | 'lvm_services': ['lvm2-monitor'], | ||||
}, | }, |
{%- else %} | {%- else %} | ||||
- proto: {{ interface.get('proto', 'dhcp') }} | - proto: {{ interface.get('proto', 'dhcp') }} | ||||
{%- endif %} | {%- endif %} | ||||
# IPv6 | |||||
{%- if interface.enable_ipv6 is defined %} | |||||
- enable_ipv6: {{ interface.enable_ipv6 }} | |||||
{%- if interface.ipv6ipaddr is defined %} | |||||
{%- if grains.os_family == 'Debian' %} | |||||
- ipv6proto: {{ interface.get('ipv6proto', 'static') }} | |||||
{%- endif %} | |||||
- ipv6ipaddr: {{ interface.ipv6ipaddr }} | |||||
- ipv6gateway: {{ interface.ipv6gateway }} | |||||
- ipv6netmask: {{ interface.ipv6netmask }} | |||||
{%- endif %} | |||||
{%- endif %} | |||||
{%- if interface.type == 'slave' %} | {%- if interface.type == 'slave' %} | ||||
- master: {{ interface.master }} | - master: {{ interface.master }} | ||||
{%- endif %} | {%- endif %} |
- name: {{ volume.get('name', lvname) }} | - name: {{ volume.get('name', lvname) }} | ||||
- vgname: {{ vg.get('name', vgname) }} | - vgname: {{ vg.get('name', vgname) }} | ||||
- size: {{ volume.size }} | - size: {{ volume.size }} | ||||
- force: true | |||||
{%- if (volume.force is defined and volume.force is sameas true) or | |||||
(volume.get('name', lvname) not in grains.lvm[vg.get('name', vgname)]) %} | |||||
- force: True | |||||
{%- else %} | |||||
- force: False | |||||
{%- endif %} | |||||
- require: | - require: | ||||
- lvm: lvm_vg_{{ vg.get('name', vgname) }} | - lvm: lvm_vg_{{ vg.get('name', vgname) }} | ||||
{%- if volume.mount is defined %} | |||||
{%- if (volume.mount is defined) and | |||||
(volume.get('name', lvname) not in grains.lvm[vg.get('name', vgname)]) %} | |||||
- require_in: | - require_in: | ||||
- mount: {{ volume.mount.path }} | - mount: {{ volume.mount.path }} | ||||
{%- if not volume.mount.get('file_system', None) in ['nfs', 'nfs4', 'cifs', 'tmpfs', None] %} | {%- if not volume.mount.get('file_system', None) in ['nfs', 'nfs4', 'cifs', 'tmpfs', None] %} |
{%- if mount.enabled %} | {%- if mount.enabled %} | ||||
{%- if not mount.file_system in ['nfs', 'nfs4', 'cifs', 'tmpfs'] %} | |||||
{%- if not mount.file_system in ['nfs', 'nfs4', 'cifs', 'tmpfs', 'none'] %} | |||||
mkfs_{{ mount.device}}: | mkfs_{{ mount.device}}: | ||||
cmd.run: | cmd.run: | ||||
- fstype: {{ mount.file_system }} | - fstype: {{ mount.file_system }} | ||||
- mkmnt: True | - mkmnt: True | ||||
- opts: {{ mount.get('opts', 'defaults,noatime') }} | - opts: {{ mount.get('opts', 'defaults,noatime') }} | ||||
- dump: {{ mount.dump|default('0', true) }} | |||||
- pass_num: {{ mount.pass_num|default('0', true) }} | |||||
{%- if mount.file_system == 'xfs' %} | {%- if mount.file_system == 'xfs' %} | ||||
- require: | - require: | ||||
- pkg: xfs_packages_{{ mount.device }} | - pkg: xfs_packages_{{ mount.device }} |
{%- endif %} | {%- endif %} | ||||
{%- if file.template is defined %} | {%- if file.template is defined %} | ||||
- template: {{ file.template }} | - template: {{ file.template }} | ||||
{%- if file.defaults is defined %} | |||||
- defaults: {{ file.defaults|json }} | |||||
{%- endif %} | |||||
{%- if file.context is defined %} | |||||
- context: {{ file.context|json }} | |||||
{%- endif %} | |||||
{%- endif %} | {%- endif %} | ||||
{%- elif file.contents is defined %} | {%- elif file.contents is defined %} | ||||
- contents: {{ file.contents|json }} | - contents: {{ file.contents|json }} |