Browse Source

Merge "Fix/Feature: RHEL repo.enabled=False; use pkgrepo.abset"

pull/139/head
Filip Pytloun 7 years ago
parent
commit
904ca2ef73
1 changed files with 24 additions and 2 deletions
  1. +24
    -2
      linux/system/repo.sls

+ 24
- 2
linux/system/repo.sls View File

{%- if repo.ppa is defined %} {%- if repo.ppa is defined %}
- ppa: {{ repo.ppa }} - ppa: {{ repo.ppa }}
{%- else %} {%- else %}
- human_name: {{ name }}
- humanname: {{ name }}
- name: {{ repo.source }} - name: {{ repo.source }}
{%- if repo.architectures is defined %} {%- if repo.architectures is defined %}
- architectures: {{ repo.architectures }} - architectures: {{ repo.architectures }}
{%- else %} {%- else %}


linux_repo_{{ name }}_absent: linux_repo_{{ name }}_absent:
pkgrepo.absent:
{%- if repo.ppa is defined %}
- ppa: {{ repo.ppa }}
{%- if repo.key_id is defined %}
- keyid_ppa: {{ repo.keyid_ppa }}
{%- endif %}
{%- else %}
- name: {{ repo.source }}
- file: /etc/apt/sources.list.d/{{ name }}.list
{%- if repo.key_id is defined %}
- keyid: {{ repo.key_id }}
{%- endif %}
{%- endif %}
file.absent: file.absent:
- name: /etc/apt/sources.list.d/{{ name }}.list - name: /etc/apt/sources.list.d/{{ name }}.list




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


{#- os_family Debian #}
{%- endif %} {%- endif %}


{%- if grains.os_family == "RedHat" %} {%- if grains.os_family == "RedHat" %}


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

{%- if repo.get('proxy', {}).get('enabled', False) %} {%- if repo.get('proxy', {}).get('enabled', False) %}
# PLACEHOLDER # PLACEHOLDER
# TODO, implement per proxy configuration for Yum # TODO, implement per proxy configuration for Yum
{%- endif %} {%- endif %}


{%- if not repo.get('default', False) %} {%- if not repo.get('default', False) %}

linux_repo_{{ name }}: linux_repo_{{ name }}:
pkgrepo.managed: pkgrepo.managed:
- name: {{ name }} - name: {{ name }}
{%- endif %} {%- endif %}
- require: - require:
- pkg: linux_repo_prereq_pkgs - pkg: linux_repo_prereq_pkgs
{%- endif %}


{#- repo.enabled is false #}
{%- else %}
pkgrepo.absent:
- name: {{ repo.source }}
{%- endif %} {%- endif %}


{#- os_family Redhat #}
{%- endif %} {%- endif %}


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


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

Loading…
Cancel
Save