iteritems() was dropped in recent Python3 releases and items() is compatible with Python 2.7.pull/144/head
@@ -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 %} | |||
{#- |
@@ -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 %} | |||
@@ -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 %} |
@@ -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,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,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,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 %}" |
@@ -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') -%} |
@@ -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,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 -%} |
@@ -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 %} |
@@ -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 %} |
@@ -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,4 +1,4 @@ | |||
{%- for name, repo in default_repos.iteritems() %} | |||
{%- for name, repo in default_repos.items() %} | |||
# Repository {{ name }} | |||
{{ repo.source }} | |||
{%- endfor %} |
@@ -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,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,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 %} | |||
@@ -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 %} |
@@ -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 %} |
@@ -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 -%} |
@@ -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 }} |
@@ -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 }} |
@@ -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 %} |
@@ -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,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 }} |
@@ -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 }}: |
@@ -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,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 %} | |||
@@ -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: |
@@ -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,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 %} | |||
@@ -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: |
@@ -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,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: |
@@ -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 %} | |||
@@ -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) %} | |||
@@ -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) %} |
@@ -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,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,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 }}: |
@@ -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 }} |
@@ -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: |
@@ -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 }}: |
@@ -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 %} |
@@ -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,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 }}: |
@@ -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. #} |
@@ -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 %} | |||