Skip to content
Snippets Groups Projects
Select Git revision
  • 1f037dd12da2422e78e6a2702249af7e76ee17a4
  • main default
  • hsh-MOODLE_404+
  • hsh_3.10
  • master protected
  • v1.4.7
  • v1.4.6
  • v1.4.5
  • v1.4.3
  • v1.4.1
  • v1.4
  • v1.3r2
  • v1.3
  • v1.2
14 results

index.js

Blame
  • install.sls 2.99 KiB
    ###  mysql/macos/install.sls
    # -*- coding: utf-8 -*-
    # vim: ft=yaml
    {%- from salt.file.dirname(tpldir) ~ "/map.jinja" import mysql with context %}
    
      {%- set dl = mysql.macos.dl %}
    
    mysql-macos-extract-dirs:
      file.directory:
        - name: {{ dl.tmpdir }}
        - makedirs: True
    
      {%- for product, data in mysql.macos.products.items() if "enabled" in data and data.enabled %}
          {%- set archivefile = data.url.split('/')[-1] %}
          {%- set archiveformat = archivefile.split('.')[-1] %}
          {%- set archivename = archivefile|replace('.dmg', '')|replace('.tar.gz', '')|replace('.zip', '') %}
    
    mysql-macos-download-{{ product }}-archive:
      pkg.installed:
        - name: curl
      cmd.run:
        - name: curl {{ dl.opts }} -o {{ dl.tmpdir }}/{{ archivefile }} {{ data.url }}
        - unless: test -f {{ dl.tmpdir }}/{{ archivefile }}
          {% if grains['saltversioninfo'] >= [2017, 7, 0] %}
        - retry:
            attempts: {{ dl.retries }}
            interval: {{ dl.interval }}
            until: True
            splay: 10
          {% endif %}
        - require:
          - mysql-macos-extract-dirs
    
        {%- if data.sum %}
    mysql-macos-check-{{ product }}-archive-hash:
       module.run:
         - name: file.check_hash
         - path: {{ dl.tmpdir }}/{{ archivefile }}
         - file_hash: {{ data.sum }}
         - require:
           - cmd: mysql-macos-download-{{ product }}-archive
         - require_in:
           - mysql-macos-{{ product }}-install
        {%- endif %}
    
    mysql-macos-{{ product }}-install:
        {%- if archiveformat in ("dmg",) %}
    
      macpackage.installed:
        - name: "{{ dl.tmpdir }}/{{ archivefile }}"
        - dmg: True
        - app: {{ 'True' if "isapp" not in data else data.isapp }}
        - force: True
        - allow_untrusted: True
        - onchanges:
          - mysql-macos-download-{{ product }}-archive
    
        {%- elif archiveformat in ("gz", "zip",) %}
    
      archive.extracted:
        - source: file://{{ dl.tmpdir }}{{ archivefile }}
        - name: {{ dl.prefix }}/{{ archivename }}
        - trim_output: True
        - source_hash: {{ data.sum }}
        - onchanges:
          - mysql-macos-download-{{ product }}-archive
        {%- endif %}
    
          {%- if "path" in data and data.path and "app" in data and data.app %}