Commit 4c1c5904 authored by Daniel Dehennin's avatar Daniel Dehennin
Browse files

doc(readme): how to use the formula

Only with `salt-ssh` for now.
parent 86038e91
.. _readme:
Setup discourse with `SaltStack`_
Setup and configure `discourse`_ container deployed with `discourse_docker`_ repository.
.. contents:: **Table of Contents**
.. _deployment-using-salt-ssh:
Deployment using `salt-ssh`_
If your distribution does not provide a recent enough `salt-ssh`_ you can configure an `additional repository`_.
First, you need to `configure salt-ssh <#configuring-salt-ssh>`_.
To work around a `bug in salt-ssh that prevent using gitfs`_, we need to manually clone the formula.
.. code-block:: bash
git clone ``~/.salt/srv/formulas/``
Then, we make the formula available to minions by linking it's directory in the `salt fileserver`_
.. code-block:: bash
ln -s ~/.salt/srv/formula/discourse-formula/discourse ~/.salt/srv/salt/discourse
.. code-block:: bash
salt-ssh state.apply discourse
You can can execute ``laucher`` command directly with `salt-ssh`_ or apply ``states`` one by one, for more information on which ``states`` are available you should read the `formula documentation`_.
Configuring ``salt-ssh``
Then, to be able to `use salt-ssh as non root user`_, you need to configure several files.
Here is the configuration `based on mine <>`_.
``Saltfile`` to tell `salt-ssh`_ where is the configuration directory
Create the file ``~/.salt/Saltfile`` with the following content
.. code-block:: yaml
# -*- yaml -*-
# Expanding ~ is working here
config_dir: ~/.salt
``master`` configuration file
This file will set different parameters to tell `salt-ssh`_:
- to not create files outside our home directory
- to look for `states`_ and `pillars`_ under our home directory ``~/.salt/srv/``
.. code-block:: yaml
# -*- mode: yaml; coding: utf-8 -*-
#### Global parameters
# Unfortunately, salt does not support ~ expension
# We need to use absolute path for `root_dir`
root_dir: /home/me/.salt
pki_dir: pki
cachedir: cache
sock_dir: run
pidfile: pids
log_file: logs/master.log
key_logfile: logs/key.log
# Global level logged in file
log_level_logfile: debug
## file server
- roots
# Unfortunately, salt does not support ~ expension
# We need to use absolute path for `file_roots` and `pillar_roots`
- /home/me/.salt/srv/salt/
- /home/me/.salt/srv/pillar/
#### Salt-SSH specific configuration
ssh_log_file: logs/ssh.log
ssh_use_home_key: True
ssh_timeout: 5
`roster`_ file declares the list of minions
This file is associate several parameters to a host:
- a ``name`` to use as `target`_
- a ``user``
- use ``sudo`` if the ``user`` is not ``root``
.. code-block:: yaml
# -*- yaml -*-
user: debian
sudo: True
.. _SaltStack:
.. _salt-ssh:
.. _additional repository:
.. _bug in salt-ssh that prevent using gitfs:
.. _salt fileserver:
.. _use salt-ssh as non root user:
.. _use-salt-ssh-non-root:
.. _formula documentation: docs/README.rst
.. _states:
.. _pillars:
.. _roster:
.. _target:
.. _discourse:
.. _discourse_docker:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment