Pārlūkot izejas kodu

Use items() instead of iteritems() for Python3 compatibility.

iteritems() was dropped in recent Python3 releases and items() is compatible
with Python 2.7.
pull/144/head
Michael Fladischer pirms 6 gadiem
vecāks
revīzija
1e41e3065d
48 mainītis faili ar 75 papildinājumiem un 75 dzēšanām
  1. +1
    -1
      linux/files/apt.conf
  2. +3
    -3
      linux/files/cgconfig.conf
  3. +2
    -2
      linux/files/cgrules.conf
  4. +1
    -1
      linux/files/dhclient.conf
  5. +1
    -1
      linux/files/dpdk_interfaces
  6. +1
    -1
      linux/files/etc_environment
  7. +1
    -1
      linux/files/grub_hugepages
  8. +1
    -1
      linux/files/hosts
  9. +1
    -1
      linux/files/lvm.conf
  10. +1
    -1
      linux/files/motd.sh
  11. +1
    -1
      linux/files/netconsole.conf
  12. +3
    -3
      linux/files/nslcd.conf
  13. +1
    -1
      linux/files/prompt.sh
  14. +1
    -1
      linux/files/sources.list
  15. +4
    -4
      linux/files/sudoer-aliases
  16. +1
    -1
      linux/files/sudoer-groups
  17. +1
    -1
      linux/files/sudoer-users
  18. +2
    -2
      linux/files/sysfs.conf
  19. +2
    -2
      linux/files/systemd-network.conf
  20. +2
    -2
      linux/files/systemd.conf
  21. +1
    -1
      linux/meta/meta.yml
  22. +3
    -3
      linux/network/dpdk.sls
  23. +3
    -3
      linux/network/host.sls
  24. +3
    -3
      linux/network/interface.sls
  25. +2
    -2
      linux/network/systemd.sls
  26. +1
    -1
      linux/storage/disk.sls
  27. +3
    -3
      linux/storage/lvm.sls
  28. +1
    -1
      linux/storage/swap.sls
  29. +1
    -1
      linux/system/apt.sls
  30. +1
    -1
      linux/system/certificate.sls
  31. +3
    -3
      linux/system/config.sls
  32. +1
    -1
      linux/system/console.sls
  33. +2
    -2
      linux/system/directory.sls
  34. +1
    -1
      linux/system/file.sls
  35. +1
    -1
      linux/system/group.sls
  36. +1
    -1
      linux/system/hugepages.sls
  37. +1
    -1
      linux/system/job.sls
  38. +2
    -2
      linux/system/kernel.sls
  39. +1
    -1
      linux/system/limit.sls
  40. +1
    -1
      linux/system/locale.sls
  41. +1
    -1
      linux/system/motd.sls
  42. +1
    -1
      linux/system/netconsole.sls
  43. +2
    -2
      linux/system/package.sls
  44. +1
    -1
      linux/system/profile.sls
  45. +2
    -2
      linux/system/repo.sls
  46. +1
    -1
      linux/system/service.sls
  47. +2
    -2
      linux/system/sysfs.sls
  48. +1
    -1
      linux/system/user.sls

+ 1
- 1
linux/files/apt.conf Parādīt failu

@@ -1,7 +1,7 @@
// apt.conf file managed by salt-minion
// DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

{%- for key, value in config.iteritems() %}
{%- for key, value in config.items() %}
{{ key }} {% if value is iterable and value is not string %}{ {% for entry in value %}"{{ entry }}";{% endfor %} } {% else %}{{ value }};{% endif %}
{%- endfor %}
{#-

+ 3
- 3
linux/files/cgconfig.conf Parādīt failu

@@ -2,11 +2,11 @@
##
## This is cgconfig configuration file is managed by Salt
##
{%- for cgroup_name, cg in system.cgroup.group.iteritems() %}
{%- for cgroup_name, cg in system.cgroup.group.items() %}
group {{ cgroup_name }} {
{%- for controller_name, controller in cg.controller.iteritems() %}
{%- for controller_name, controller in cg.controller.items() %}
{{ controller_name }} {
{%- for v_name, v in controller.iteritems() %}
{%- for v_name, v in controller.items() %}
{{ controller_name }}.{{ v_name }}="{{ v.value }}";
{%- endfor %}


+ 2
- 2
linux/files/cgrules.conf Parādīt failu

@@ -3,8 +3,8 @@
## This is cgrules configuration file is managed by Salt
##
#<user/group> <controller(s)> <cgroup>
{%- for cgroup_name, cg in system.cgroup.group.iteritems() %}
{%- for cgroup_name, cg in system.cgroup.group.items() %}
{%- for subject in cg.mapping.subjects %}
{{ subject }}{% raw %} {% endraw %}{%- for controller_name, controller in cg.controller.iteritems() -%}{{ controller_name }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%}{% raw %} {% endraw %}{{ cgroup_name }}
{{ subject }}{% raw %} {% endraw %}{%- for controller_name, controller in cg.controller.items() -%}{{ controller_name }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%}{% raw %} {% endraw %}{{ cgroup_name }}
{%- endfor %}
{%- endfor %}

+ 1
- 1
linux/files/dhclient.conf Parādīt failu

@@ -95,7 +95,7 @@ require {{ section.require|join(",\n ") }};
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
{{ render_section(dhclient) }}
{%- if dhclient.get("interface") -%}
{%- for iface_name, options in dhclient.interface.iteritems() %}
{%- for iface_name, options in dhclient.interface.items() %}
{%- if network.interface.get(iface_name) and network.interface.get(iface_name).enabled == True
and network.interface.get(iface_name).proto == 'dhcp' -%}
interface "{{ iface_name }}" {

+ 1
- 1
linux/files/dpdk_interfaces Parādīt failu

@@ -1,5 +1,5 @@
{%- from "linux/map.jinja" import network with context %}
{%- for interface_name, interface in network.interface.iteritems() %}
{%- for interface_name, interface in network.interface.items() %}
{%- if 'dpdk' in interface.type and interface.pci is defined %}
pci {{ interface.pci }} {{ interface.driver }}
{%- endif %}

+ 1
- 1
linux/files/etc_environment Parādīt failu

@@ -1,5 +1,5 @@

{%- for name,value in variables.iteritems() if not name.lower().endswith('_proxy') %}
{%- for name,value in variables.items() if not name.lower().endswith('_proxy') %}

{%- if value is sequence and value is not string %}
{{ name }}="{{ value|join(':') }}"

+ 1
- 1
linux/files/grub_hugepages Parādīt failu

@@ -1,2 +1,2 @@
{%- from "linux/map.jinja" import system with context %}
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT {%- for hugepages_type, hugepages in system.kernel.hugepages.iteritems() %}{%- if hugepages.get('default', False) %} default_hugepagesz={{ hugepages.size }} {%- endif %} hugepagesz={{ hugepages.size }} hugepages={{ hugepages.count }} {%- endfor %}"
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT {%- for hugepages_type, hugepages in system.kernel.hugepages.items() %}{%- if hugepages.get('default', False) %} default_hugepagesz={{ hugepages.size }} {%- endif %} hugepagesz={{ hugepages.size }} hugepages={{ hugepages.count }} {%- endfor %}"

+ 1
- 1
linux/files/hosts Parādīt failu

@@ -31,7 +31,7 @@
'ip6-allhosts'
],
} -%}
{%- for name, host in host_dict.iteritems() -%}
{%- for name, host in host_dict.items() -%}
{%- for hname in host.names -%}
{%- if hname in hosts.get('127.0.1.1', []) -%}
{%- do hosts.pop('127.0.1.1') -%}

+ 1
- 1
linux/files/lvm.conf Parādīt failu

@@ -129,7 +129,7 @@ devices {
# Example
# Accept every block device:

filter = [ {%- for vgname, vg in storage.lvm.iteritems() %}{%- if vg.get('enabled', True) %}{%- for dev in vg.devices %}"a|{{ dev }}*|"{%- if not loop.last %},{%- endif %}{%- endfor %}{%- endif %}{%- endfor %}, "r|.*|" ]
filter = [ {%- for vgname, vg in storage.lvm.items() %}{%- if vg.get('enabled', True) %}{%- for dev in vg.devices %}"a|{{ dev }}*|"{%- if not loop.last %},{%- endif %}{%- endfor %}{%- endif %}{%- endfor %}, "r|.*|" ]

# filter = [ "a|.*/|" ]
# Reject the cdrom drive:

+ 1
- 1
linux/files/motd.sh Parādīt failu

@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import system with context -%}
{%- for motd in system.motd -%}
{%- if loop.index == index -%}
{%- for name, value in motd.iteritems() -%}
{%- for name, value in motd.items() -%}
{%- if name == motd_name -%}{{ value }}{%- endif %}
{%- endfor -%}
{%- endif -%}

+ 1
- 1
linux/files/netconsole.conf Parādīt failu

@@ -8,7 +8,7 @@ PORT="{{ system.netconsole.port }}"
# unicast, could be multiline
#netconsole ens3 192.168.1.32 fa:16:3e:8d:f6:d0
{%- if system.netconsole is mapping and system.netconsole.target is mapping %}
{%- for target, data in system.netconsole.target.iteritems() %}
{%- for target, data in system.netconsole.target.items() %}
{%- if data is mapping %}
netconsole "{{ data.get('interface', '${interface}') }}" "{{ target }}" "{{ data.get('mac', '') }}"
{%- endif %}

+ 3
- 3
linux/files/nslcd.conf Parādīt failu

@@ -52,14 +52,14 @@ referrals {{ ldap.referrals }}

{%- if ldap.filter is defined %}
# Filters
{%- for key, value in ldap.filter.iteritems() %}
{%- for key, value in ldap.filter.items() %}
filter {{ key }} {{ value }}
{%- endfor %}
{%- endif %}
{%- if ldap.map is defined %}
# Mappings
{%- for map_name,map in ldap.map.iteritems() %}
{%- for key, value in map.iteritems() %}
{%- for map_name,map in ldap.map.items() %}
{%- for key, value in map.items() %}
map {{ map_name }} {{ key }} {{ value }}
{%- endfor %}
{%- endfor %}

+ 1
- 1
linux/files/prompt.sh Parādīt failu

@@ -6,7 +6,7 @@
# Don't set prompt on non-interactive shell
[[ $- == *i* ]] || return 0

{%- for user, prompt in system.prompt.iteritems() %}
{%- for user, prompt in system.prompt.items() %}
{% if user != "default" %}
if [ "$USERNAME" == "{{ user }}" ]; then
export PS1="{{ prompt }} "

+ 1
- 1
linux/files/sources.list Parādīt failu

@@ -1,4 +1,4 @@
{%- for name, repo in default_repos.iteritems() %}
{%- for name, repo in default_repos.items() %}
# Repository {{ name }}
{{ repo.source }}
{%- endfor %}

+ 4
- 4
linux/files/sudoer-aliases Parādīt failu

@@ -1,19 +1,19 @@
# sudoer aliases, file managed by salt-minion
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

{%- for alias,commands in aliases.get('command',{}).iteritems() %}
{%- for alias,commands in aliases.get('command',{}).items() %}
Cmnd_Alias {{ alias }}={{ commands|join(', ') }}
{%- endfor %}

{%- for alias,users in aliases.get('user',{}).iteritems() %}
{%- for alias,users in aliases.get('user',{}).items() %}
User_Alias {{ alias }}={{ users|join(', ') }}
{%- endfor %}

{%- for alias,users in aliases.get('runas',{}).iteritems() %}
{%- for alias,users in aliases.get('runas',{}).items() %}
Runas_Alias {{ alias }}={{ users|join(', ') }}
{%- endfor %}

{%- for alias,hosts in aliases.get('host',{}).iteritems() %}
{%- for alias,hosts in aliases.get('host',{}).items() %}
Host_Alias {{ alias }}={{ hosts|join(', ') }}
{%- endfor %}


+ 1
- 1
linux/files/sudoer-groups Parādīt failu

@@ -1,7 +1,7 @@
# sudoer groups, file managed by salt-minion
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

{%- for group,spec in groups.iteritems() %}
{%- for group,spec in groups.items() %}
%{{ spec.name|default(group) }} {{ spec.get('hosts', ['ALL'])|join(',') }}=({{ spec.get('runas', ['ALL'])|join(', ') }}) {% if spec.get('nopasswd', True) %}NOPASSWD: {% endif %}{{ spec.get('commands', ['ALL'])|join(', ') }}
{%- endfor %}


+ 1
- 1
linux/files/sudoer-users Parādīt failu

@@ -1,7 +1,7 @@
# sudoer users, file managed by salt-minion
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

{%- for user,spec in users.iteritems() %}
{%- for user,spec in users.items() %}
{{ spec.name|default(user) }} {{ spec.get('hosts', ['ALL'])|join(',') }}=({{ spec.get('runas', ['ALL'])|join(', ') }}) {% if spec.get('nopasswd', True) %}NOPASSWD:{% endif %}{% if spec.get('setenv', False) %}SETENV:{% endif %} {{ spec.get('commands', ['ALL'])|join(', ') }}
{%- endfor %}


+ 2
- 2
linux/files/sysfs.conf Parādīt failu

@@ -1,9 +1,9 @@
# Sysfs file for {{ name }} managed by salt-minion(1)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

{%- for key, value in sysfs.iteritems() %}
{%- for key, value in sysfs.items() %}
{%- if key in ["mode", "owner"] %}
{%- for attr, val in value.iteritems() %}
{%- for attr, val in value.items() %}
mode {{ attr }} = {{ val }}
{%- endfor %}
{%- else %}

+ 2
- 2
linux/files/systemd-network.conf Parādīt failu

@@ -1,8 +1,8 @@
{%- from "linux/map.jinja" import system with context -%}
{%- for section, options in settings.iteritems() %}
{%- for section, options in settings.items() %}

[{{ section[0].upper() + section[1:] }}]
{%- for option, value in options.iteritems() %}
{%- for option, value in options.items() %}
{{ option[0].upper() + option[1:] }}={{ value }}
{%- endfor %}
{%- endfor %}

+ 2
- 2
linux/files/systemd.conf Parādīt failu

@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import system with context -%}
{%- for section, options in settings.iteritems() %}
{%- for section, options in settings.items() %}
[{{ section }}]
{%- for option, value in options.iteritems() %}
{%- for option, value in options.items() %}
{{ option }}={{ value }}
{%- endfor -%}
{%- endfor -%}

+ 1
- 1
linux/meta/meta.yml Parādīt failu

@@ -6,7 +6,7 @@ graph:
type: software-system
relations:
{%- if system.repo is defined %}
{%- for repo_name, repo in system.repo.iteritems() %}
{%- for repo_name, repo in system.repo.items() %}
{%- if repo.get('enabled', True) %}
- service: apt.repo
host_external: {{ repo.source }}

+ 3
- 3
linux/network/dpdk.sls Parādīt failu

@@ -82,19 +82,19 @@ service_openvswitch:

{%- endif %}

{%- for interface_name, interface in network.interface.iteritems() if interface.get('enabled', True) %}
{%- for interface_name, interface in network.interface.items() if interface.get('enabled', True) %}

{%- if interface.type == "dpdk_ovs_bond" %}

{%- set bond_interfaces = {} %}
{%- for iface_name, iface in network.interface.iteritems() if iface.get('enabled', True) and iface.get('bond',"") == interface_name %}
{%- for iface_name, iface in network.interface.items() if iface.get('enabled', True) and iface.get('bond',"") == interface_name %}
{#- Get list of child interfaces #}
{%- do bond_interfaces.update({iface_name: iface}) %}
{%- endfor %}

linux_network_dpdk_bond_interface_{{ interface_name }}:
cmd.run:
- name: "ovs-vsctl add-bond {{ interface.bridge }} {{ interface_name }} {{ bond_interfaces.keys()|join(' ') }} {% for iface_name, iface in bond_interfaces.iteritems() %}-- set Interface {{ iface_name }} type=dpdk options:dpdk-devargs={{ iface.pci }} {% endfor %}"
- name: "ovs-vsctl add-bond {{ interface.bridge }} {{ interface_name }} {{ bond_interfaces.keys()|join(' ') }} {% for iface_name, iface in bond_interfaces.items() %}-- set Interface {{ iface_name }} type=dpdk options:dpdk-devargs={{ iface.pci }} {% endfor %}"
- unless: "ovs-vsctl show | grep {{ interface_name }}"
- require:
- cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }}

+ 3
- 3
linux/network/host.sls Parādīt failu

@@ -5,7 +5,7 @@

{%- if network.mine_dns_records %}

{%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}
{%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').items() %}
{%- if node_grains.get('dns_records', []) is iterable %}
{%- for record in node_grains.get('dns_records', []) %}
{%- set record_key = node_name ~ '-' ~ loop.index %}
@@ -28,12 +28,12 @@ linux_hosts:

{%- else %}

{%- for name, host in host_dict.iteritems() %}
{%- for name, host in host_dict.items() %}

{%- if host.names is defined %}

{%- set clearers = [] %}
{%- for etc_addr, etc_names in salt.hosts.list_hosts().iteritems() %}
{%- for etc_addr, etc_names in salt.hosts.list_hosts().items() %}
{%- set names_to_clear = [] %}
{%- for host_name in host.names %}
{%- if (host.address != etc_addr) and host_name in etc_names %}

+ 3
- 3
linux/network/interface.sls Parādīt failu

@@ -53,7 +53,7 @@ remove_cloud_init_file:

{%- endif %}

{%- for interface_name, interface in network.interface.iteritems() %}
{%- for interface_name, interface in network.interface.items() %}

{%- set interface_name = interface.get('name', interface_name) %}

@@ -69,7 +69,7 @@ ovs_bridge_{{ interface_name }}:
- name: {{ interface_name }}

{# add linux network interface into OVS bridge #}
{%- for int_name, int in network.interface.iteritems() %}
{%- for int_name, int in network.interface.items() %}

{%- set int_name = int.get('name', int_name) %}

@@ -340,7 +340,7 @@ linux_network_{{ interface_name }}_routes:
network.routes:
- name: {{ interface_name }}
- routes:
{%- for route_name, route in interface.route.iteritems() %}
{%- for route_name, route in interface.route.items() %}
- name: {{ route_name }}
ipaddr: {{ route.address }}
netmask: {{ route.netmask }}

+ 2
- 2
linux/network/systemd.sls Parādīt failu

@@ -2,7 +2,7 @@
{%- if network.enabled and grains.get('init', None) == 'systemd' %}

{%- if network.systemd is mapping %}
{%- for config_type, configs in network.systemd.iteritems() %}
{%- for config_type, configs in network.systemd.items() %}

{%- if config_type == 'link' %}
/etc/udev/rules.d/80-net-setup-link.rules:
@@ -11,7 +11,7 @@
- content: ""
{%- endif %}

{%- for config_name, config in configs.iteritems() %}
{%- for config_name, config in configs.items() %}
linux_network_systemd_networkd_{{ config_type }}_config_{{ config_name }}:
file.managed:
- name: /etc/systemd/network/{{ config_name }}.{{ config_type }}

+ 1
- 1
linux/storage/disk.sls Parādīt failu

@@ -7,7 +7,7 @@ parted:
xfsprogs:
pkg.installed

{%- for disk_name, disk in storage.disk.iteritems() %}
{%- for disk_name, disk in storage.disk.items() %}
{%- set disk_name = disk.name|default(disk_name) %}

create_disk_label_{{ disk_name }}:

+ 3
- 3
linux/storage/lvm.sls Parādīt failu

@@ -22,7 +22,7 @@ lvm_services:
- watch:
- file: /etc/lvm/lvm.conf

{%- for vgname, vg in storage.lvm.iteritems() %}
{%- for vgname, vg in storage.lvm.items() %}

{%- if vg.get('enabled', True) %}

@@ -43,7 +43,7 @@ lvm_vg_{{ vg.get('name', vgname) }}:
- name: {{ vg.get('name', vgname) }}
- devices: {{ vg.devices|join(',') }}

{%- for lvname, volume in vg.get('volume', {}).iteritems() %}
{%- for lvname, volume in vg.get('volume', {}).items() %}

lvm_{{ vg.get('name', vgname) }}_lv_{{ volume.get('name', lvname) }}:
lvm.lv_present:
@@ -66,4 +66,4 @@ lvm_{{ vg.get('name', vgname) }}_lv_{{ volume.get('name', lvname) }}:

{%- endfor %}

{%- endif %}
{%- endif %}

+ 1
- 1
linux/storage/swap.sls Parādīt failu

@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import storage with context %}
{%- if storage.enabled %}

{%- for swap_name, swap in storage.swap.iteritems() %}
{%- for swap_name, swap in storage.swap.items() %}

{%- if swap.enabled %}


+ 1
- 1
linux/system/apt.sls Parādīt failu

@@ -7,7 +7,7 @@ include:
- linux.system.repo
{%- endif %}

{%- for key, config in system.apt.get('config', {}).iteritems() %}
{%- for key, config in system.apt.get('config', {}).items() %}

linux_apt_conf_{{ key }}:
file.managed:

+ 1
- 1
linux/system/certificate.sls Parādīt failu

@@ -8,7 +8,7 @@ linux_system_ca_certificates:
- name: ca-certificates
{%- if system.ca_certificates is mapping %}

{%- for name, cert in system.ca_certificates.iteritems() %}
{%- for name, cert in system.ca_certificates.items() %}
{{ system.ca_certs_dir }}/{{ name }}.crt:
file.managed:
- contents_pillar: "linux:system:ca_certificates:{{ name }}"

+ 3
- 3
linux/system/config.sls Parādīt failu

@@ -3,13 +3,13 @@

{%- if system.enabled %}

{%- for config_name, config in system.get('config', {}).iteritems() %}
{%- for config_name, config in system.get('config', {}).items() %}
{%- if config.enabled|default(True) %}
{%- for service_name in config.pillar.keys() %}
{%- if pillar.get(service_name, {}).get('_support', {}).get('config', {}).get('enabled', False) %}
{%- set support_fragment_file = service_name+'/meta/config.yml' %}
{%- set service_config_files = load_support_file(support_fragment_file, config.pillar, config.get('grains', {}))|load_yaml %}
{%- for service_config_name, service_config in service_config_files.config.iteritems() %}
{%- for service_config_name, service_config in service_config_files.config.items() %}

{{ service_config.path }}:
file.managed:
@@ -24,7 +24,7 @@
- defaults:
pillar: {{ config.pillar|yaml }}
grains: {{ config.get('grains', {}) }}
{%- for key, value in service_config.get('defaults', {}).iteritems() %}
{%- for key, value in service_config.get('defaults', {}).items() %}
{{ key }}: {{ value }}
{%- endfor %}


+ 1
- 1
linux/system/console.sls Parādīt failu

@@ -3,7 +3,7 @@

{%- if system.console is defined %}

{%- for tty_name, console in system.console.iteritems() %}
{%- for tty_name, console in system.console.items() %}

{%- if grains.get('init', None) == 'upstart' %}
{{ tty_name }}_service_file:

+ 2
- 2
linux/system/directory.sls Parādīt failu

@@ -1,11 +1,11 @@
{%- from "linux/map.jinja" import system with context %}

{%- for name, dir in system.directory.iteritems() %}
{%- for name, dir in system.directory.items() %}

{{ dir.name|default(name) }}:
file.directory:
{%- if dir %}
{%- for key, value in dir.iteritems() %}
{%- for key, value in dir.items() %}
- {{ key }}: {{ value }}
{%- endfor %}
{%- else %}

+ 1
- 1
linux/system/file.sls Parādīt failu

@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}

{%- for file_name, file in system.file.iteritems() %}
{%- for file_name, file in system.file.items() %}

linux_file_{{ file_name }}:
file.managed:

+ 1
- 1
linux/system/group.sls Parādīt failu

@@ -7,7 +7,7 @@
{%- endif -%}
{%- endmacro -%}

{%- for group_name, group in system.group.iteritems() %}
{%- for group_name, group in system.group.items() %}

{%- if group.enabled %}


+ 1
- 1
linux/system/hugepages.sls Parādīt failu

@@ -17,7 +17,7 @@ include:

{%- endif %}

{%- for hugepages_type, hugepages in system.kernel.hugepages.iteritems() %}
{%- for hugepages_type, hugepages in system.kernel.hugepages.items() %}

{%- if hugepages.get('mount', False) or hugepages.get('default', False) %}


+ 1
- 1
linux/system/job.sls Parādīt failu

@@ -4,7 +4,7 @@
include:
- linux.system.user

{%- for name, job in system.job.iteritems() %}
{%- for name, job in system.job.items() %}

linux_job_{{ job.command }}:
{%- if job.enabled|default(True) %}

+ 2
- 2
linux/system/kernel.sls Parādīt failu

@@ -56,7 +56,7 @@ linux_kernel_module_{{ module }}:

{%- endfor %}

{%- for module_name, module_content in system.kernel.get('module', {}).iteritems() %}
{%- for module_name, module_content in system.kernel.get('module', {}).items() %}

/etc/modprobe.d/{{ module_name }}.conf:
file.managed:
@@ -71,7 +71,7 @@ linux_kernel_module_{{ module }}:

{%- endfor %}

{%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).iteritems() %}
{%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).items() %}

linux_kernel_{{ sysctl_name }}:
sysctl.present:

+ 1
- 1
linux/system/limit.sls Parādīt failu

@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}

{%- for name, limit in system.limit.iteritems() %}
{%- for name, limit in system.limit.items() %}

linux_limit_{{ name }}:
{%- if limit.get('enabled', True) %}

+ 1
- 1
linux/system/locale.sls Parādīt failu

@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}

{%- for locale_name, locale in system.locale.iteritems() %}
{%- for locale_name, locale in system.locale.items() %}
{%- if locale.get('enabled', True) %}

linux_locale_{{ locale_name }}:

+ 1
- 1
linux/system/motd.sls Parādīt failu

@@ -36,7 +36,7 @@ motd_fix_pam_sshd:
{%- for motd in system.motd %}
{%- set motd_index = loop.index %}

{%- for name, value in motd.iteritems() %}
{%- for name, value in motd.items() %}
motd_{{ motd_index }}_{{ name }}:
file.managed:
- name: /etc/update-motd.d/5{{ motd_index }}-{{ name }}

+ 1
- 1
linux/system/netconsole.sls Parādīt failu

@@ -24,7 +24,7 @@
- template: jinja

{% if system.netconsole is mapping and system.netconsole.target is mapping %}
{% for target, data in system.netconsole.target.iteritems() %}
{% for target, data in system.netconsole.target.items() %}
{% if data is mapping and data.interface is defined %}
/etc/network/if-up.d/netconsole {{ target }} {{ data.interface }}:
cmd.run:

+ 2
- 2
linux/system/package.sls Parādīt failu

@@ -7,7 +7,7 @@
'removed': [],
'installed': [],
} %}
{%- for name, package in system.package.iteritems() %}
{%- for name, package in system.package.items() %}

{%- if package.repo is defined or package.hold is defined or package.verify is defined %}
linux_extra_package_{{ name }}:
@@ -47,7 +47,7 @@ linux_extra_package_{{ name }}:

{%- endfor %}

{%- for pkgs_group, pkgs in pkgs_groups.iteritems() %}
{%- for pkgs_group, pkgs in pkgs_groups.items() %}
{%- if pkgs %}
linux_extra_packages_{{ pkgs_group }}:
pkg.{{ pkgs_group }}:

+ 1
- 1
linux/system/profile.sls Parādīt failu

@@ -9,7 +9,7 @@ profile.d_clean:

{%- if system.profile|length > 0 %}

{%- for name, script in system.profile.iteritems() %}
{%- for name, script in system.profile.items() %}
profile.d_script_{{ name }}:
file.managed:
- name: /etc/profile.d/salt_profile_{{ name }}{%if name.split('.')|length == 1 %}.sh{% endif %}

+ 2
- 2
linux/system/repo.sls Parādīt failu

@@ -38,7 +38,7 @@ purge_sources_list_d_repos:

{%- endif %}

{%- for name, repo in system.repo.iteritems() %}
{%- for name, repo in system.repo.items() %}
{%- set name=repo.get('name', name) %}
{%- if grains.os_family == 'Debian' %}

@@ -201,7 +201,7 @@ linux_repo_{{ name }}:
{#- os_family Redhat #}
{%- endif %}

{#- repo.iteritems() loop #}
{#- repo.items() loop #}
{%- endfor %}

{%- if default_repos|length > 0 and grains.os_family == 'Debian' %}

+ 1
- 1
linux/system/service.sls Parādīt failu

@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}

{%- for name, service in system.service.iteritems() %}
{%- for name, service in system.service.items() %}

linux_service_{{ name }}:
service.{{ service.status }}:

+ 2
- 2
linux/system/sysfs.sls Parādīt failu

@@ -11,7 +11,7 @@ linux_sysfs_package:
- require:
- pkg: linux_sysfs_package

{%- for name, sysfs in system.get('sysfs', {}).iteritems() %}
{%- for name, sysfs in system.get('sysfs', {}).items() %}

/etc/sysfs.d/{{ name }}.conf:
file.managed:
@@ -26,7 +26,7 @@ linux_sysfs_package:
- require:
- file: /etc/sysfs.d

{%- for key, value in sysfs.iteritems() %}
{%- for key, value in sysfs.items() %}
{%- if key not in ["mode", "owner"] %}
{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %}
{#- Sysfs cannot be set in docker, LXC, etc. #}

+ 1
- 1
linux/system/user.sls Parādīt failu

@@ -4,7 +4,7 @@
include:
- linux.system.group

{%- for name, user in system.user.iteritems() %}
{%- for name, user in system.user.items() %}

{%- if user.enabled %}


Notiek ielāde…
Atcelt
Saglabāt