Skip to content
Snippets Groups Projects
Select Git revision
  • b153463377e5ef8d24a06485b35ef2d9615094e1
  • master default
  • fix-remote-url_v4.9.1
  • fix-remote-url_v4.8.3
  • fix-remote-url_v4.8.x
  • fix-remote-url_v4.7.x
  • fix-remote-url_v4.6.0
  • fix-remote-urls
8 results

tidyquestion.php

Blame
    • Tim Hunt's avatar
      b1534633
      A script to tidy questions by renaming their parts. · b1534633
      Tim Hunt authored
      This script lets you rename parts of a question, which is something you
      cannot do using the normal question editing form because of the way the
      form works. Also, once you see the work we have to do to rename things
      throughout the question, you will understand why it needs to be a
      separate option.
      
      The script is accessed via a 'Tidy question' link next to the 'Question
      tests & deployed versions' link.
      b1534633
      History
      A script to tidy questions by renaming their parts.
      Tim Hunt authored
      This script lets you rename parts of a question, which is something you
      cannot do using the normal question editing form because of the way the
      form works. Also, once you see the work we have to do to rename things
      throughout the question, you will understand why it needs to be a
      separate option.
      
      The script is accessed via a 'Tidy question' link next to the 'Question
      tests & deployed versions' link.
    repo.sls 2.11 KiB
    include:
      - .config
    
    {% from tpldir ~ "/map.jinja" import mysql with context %}
    
    # Completely ignore non-RHEL based systems
    # TODO: Add Debian and Suse systems.
    # TODO: Allow user to specify MySQL version and alter yum repo file accordingly.
    {% if grains['os_family'] == 'RedHat' and 'osmajorrelease' in grains %}
      {% if grains['osmajorrelease']|int == 5 %}
      {% set rpm_source = "http://repo.mysql.com/mysql57-community-release-el5.rpm" %}
      {% elif grains['osmajorrelease']|int == 6 %}
      {% set rpm_source = "http://repo.mysql.com/mysql57-community-release-el6.rpm" %}
      {% elif grains['osmajorrelease']|int == 7 %}
      {% set rpm_source = "http://repo.mysql.com/mysql57-community-release-el7.rpm" %}
      {% endif %}
    {% endif %}
    
    {% set mysql57_community_release = salt['pillar.get']('mysql:release', false) %}
    # A lookup table for MySQL Repo GPG keys & RPM URLs for various RedHat releases
      {% set pkg = {
        'key': 'http://repo.mysql.com/RPM-GPG-KEY-mysql',
        'key_hash': 'md5=162ec8cb41add661b357e926a083b0cc',
        'rpm': rpm_source
     } %}
    
    
    install_pubkey_mysql:
      file.managed:
        - name: /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
        - source: {{ salt['pillar.get']('mysql:pubkey', pkg.key) }}
        - source_hash:  {{ salt['pillar.get']('mysql:pubkey_hash', pkg.key_hash) }}
    
    mysql57_community_release:
      pkg.installed:
        - sources:
          - mysql57-community-release: {{ salt['pillar.get']('mysql:repo_rpm', pkg.rpm) }}
        - require:
          - file: install_pubkey_mysql
        - require_in:
          {% if "server_config" in mysql %}
          - pkg: {{ mysql.serverpkg }}
          {% endif %}
          {% if "clients_config" in mysql %}
          - pkg: {{ mysql.clientpkg }}
          {% endif %}
    
    set_pubkey_mysql:
      file.replace:
        - append_if_not_found: True
        - name: /etc/yum.repos.d/mysql-community.repo
        - pattern: '^gpgkey=.*'
        - repl: 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'
        - require:
          - pkg: mysql57_community_release
    
    set_gpg_mysql:
      file.replace:
        - append_if_not_found: True
        - name: /etc/yum.repos.d/mysql-community.repo
        - pattern: 'gpgcheck=.*'
        - repl: 'gpgcheck=1'
        - require:
          - pkg: mysql57_community_release