Skip to content

Instantly share code, notes, and snippets.

@pduersteler
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pduersteler/a3d2144cb9d05f041ae2 to your computer and use it in GitHub Desktop.
Save pduersteler/a3d2144cb9d05f041ae2 to your computer and use it in GitHub Desktop.
# mariadb/init.sls
mariadb:
pkg.installed:
- pkgs:
- mariadb-client
include:
- repos.mariadb
# repos/mariadb.sls
# prefixed with "repos." to not have key collisions. maybe
# this is a problem?
repos.mariadb:
pkgrepo.managed:
- humanname: MariaDB
- name: deb http://mirrors.n-ix.net/mariadb/repo/10.0/debian wheezy main
- dist: wheezy
- file: /etc/apt/sources.list.d/mariadb.list
- keyserver: keyserver.ubuntu.com
- keyid: '0xcbcb082a1bb943db'
# mariadb/server.sls
mariadb.server:
pkg.installed:
- pkgs:
- mariadb-server
service.running:
- name: mysql
- enable: True
@pduersteler
Copy link
Author

With the given init.sls, I get:

salt saltmaster state.sls mariadb
saltmaster:
    Data failed to compile:
----------
    No matching sls found for 'mariadb' in env 'base'

However, removing the "include" part, salt tries to set up the package but reports a fail as it has no repo to get it from:

salt saltmaster state.sls mariadb
saltmaster:
----------
          ID: mariadb
    Function: pkg.installed
      Result: False
     Comment: The following packages failed to install/update: mariadb-client.
     Changes:   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment