@@ -1,5 +1,5 @@ | |||
============ | |||
Linux Fomula | |||
Linux Formula | |||
============ | |||
Linux Operating Systems: | |||
@@ -33,7 +33,7 @@ Basic Linux box | |||
Linux with system users, some with password set: | |||
.. warning:: If no ``password`` variable is passed, | |||
any predifined password will be removed. | |||
any predefined password will be removed. | |||
.. code-block:: yaml | |||
@@ -67,7 +67,7 @@ Linux with system users, some with password set: | |||
elizabeth: | |||
name: 'elizabeth' | |||
enabled: true | |||
full_name: 'With hased password' | |||
full_name: 'With hashed password' | |||
home: '/home/elizabeth' | |||
password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10" | |||
@@ -889,7 +889,7 @@ Optional: You can also use list that will ensure order of items. | |||
Sysfs definition with disabled automatic write. Attributes are saved | |||
to configuration, but are not applied during the run. | |||
Thay will be applied automatically after the reboot. | |||
They will be applied automatically after the reboot. | |||
.. code-block:: yaml | |||
@@ -980,7 +980,7 @@ RedHat-based Linux with additional OpenStack repo: | |||
rdo-icehouse: | |||
enabled: true | |||
source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/' | |||
pgpcheck: 0 | |||
gpgcheck: 0 | |||
Ensure system repository to use czech Debian mirror (``default: true``) | |||
Also pin it's packages with priority ``900``: |
@@ -9,22 +9,12 @@ from jinja2 import Undefined | |||
def __virtual__(): | |||
return 'linux_hosts' | |||
def fqdn_sort_fn(n1, n2): | |||
l1 = n1.split('.') | |||
l2 = n2.split('.') | |||
if len(l1) > len(l2): | |||
return -1 | |||
if len(l1) < len(l2): | |||
return 1 | |||
for i1, i2 in zip(l1, l2): | |||
if i1 < i2: | |||
return -1 | |||
if i1 > i2: | |||
return 1 | |||
return 0 | |||
def fqdn_sort_fn(n1): | |||
length = len(n1) | |||
return length | |||
def fqdn_sort_filter(iterable): | |||
if iterable is None or isinstance(iterable, Undefined): | |||
return iterable | |||
# Do effective custom sorting of iterable here | |||
return sorted(set(iterable), cmp=fqdn_sort_fn) | |||
return sorted(set(iterable), key=fqdn_sort_fn) |
@@ -22,7 +22,7 @@ def __virtual__(): | |||
def _retcode_to_bool(retcode): | |||
''' | |||
Evaulates ovs-vsctl command`s retcode value. | |||
Evaluates ovs-vsctl command`s retcode value. | |||
Args: | |||
retcode: Value of retcode field from response. |
@@ -109,7 +109,17 @@ | |||
'services': [] | |||
}, | |||
}, | |||
}, grain='os_family', merge=salt['pillar.get']('linux:system')) %} | |||
}, merge=salt['grains.filter_by']({ | |||
'bullseye': { | |||
'pkgs': ['python3-apt', 'apt-transport-https', 'libmnl0'], | |||
}, | |||
'bookworm': { | |||
'pkgs': ['python3-apt', 'apt-transport-https', 'libmnl0'], | |||
}, | |||
'sid': { | |||
'pkgs': ['python3-apt', 'apt-transport-https', 'libmnl0'], | |||
}, | |||
}, grain='oscodename', merge=salt['pillar.get']('linux:system'))) %} | |||
{% set banner = salt['grains.filter_by']({ | |||
'BaseDefaults': { | |||
@@ -383,12 +393,24 @@ Debian: | |||
}, | |||
}, | |||
}, merge=salt['grains.filter_by']({ | |||
'CentOS Stream 8': { | |||
'lvm_services': ['lvm2-lvmpolld', 'lvm2-monitor'], | |||
}, | |||
'focal': { | |||
'lvm_services': ['lvm2-monitor'], | |||
}, | |||
'buster': { | |||
'lvm_services': ['lvm2-monitor'], | |||
}, | |||
'bullseye': { | |||
'lvm_services': ['lvm2-monitor'], | |||
}, | |||
'bookworm': { | |||
'lvm_services': ['lvm2-monitor'], | |||
}, | |||
'sid': { | |||
'lvm_services': ['lvm2-monitor'], | |||
}, | |||
'trusty': { | |||
'lvm_services': ['udev'], | |||
}, |
@@ -283,6 +283,9 @@ linux_interface_{{ interface_name }}: | |||
{%- if interface.name_servers is defined %} | |||
- dns: {{ interface.name_servers }} | |||
{%- endif %} | |||
{%- if interface.metric is defined and grains.os_family == 'Debian' %} | |||
- metric: {{ interface.metric }} | |||
{%- endif %} | |||
{%- if interface.wireless is defined and grains.os_family == 'Debian' %} | |||
{%- if interface.wireless.security == "wpa" %} | |||
- wpa-ssid: {{ interface.wireless.essid }} |
@@ -16,6 +16,9 @@ linux_job_{{ job.command }}: | |||
{%- if job.get('identifier', True) %} | |||
- identifier: {{ job.get('identifier', job.get('name', name)) }} | |||
{%- endif %} | |||
{%- if job.get('commented', False) %} | |||
- commented: True | |||
{%- endif %} | |||
- user: {{ job_user }} | |||
{%- if job.special is defined %} | |||
- special: '{{ job.special }}' |
@@ -25,6 +25,10 @@ motd_fix_pam_sshd: | |||
/etc/motd: | |||
file.absent | |||
exist_/etc/update-motd.d: | |||
file.directory: | |||
- name: /etc/update-motd.d | |||
{%- for motd in system.motd %} | |||
{%- set motd_index = loop.index %} | |||
@@ -35,8 +39,10 @@ motd_{{ motd_index }}_{{ name }}: | |||
- source: salt://linux/files/motd.sh | |||
- template: jinja | |||
- mode: 755 | |||
- require: | |||
- require_in: | |||
- file: /etc/update-motd.d | |||
- require: | |||
- file: exist_/etc/update-motd.d | |||
- defaults: | |||
index: {{ motd_index }} | |||
motd_name: {{ name }} |
@@ -49,7 +49,7 @@ system_user_{{ name }}: | |||
{%- if user.gid is defined and user.gid %} | |||
- gid: {{ user.gid }} | |||
{%- else %} | |||
- gid_from_name: true | |||
- gid: {{ name }} | |||
{%- endif %} | |||
{%- if user.groups is defined %} | |||
- groups: {{ user.groups }} |