Skip to content

titooo7/saltbox_mod

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

saltbox_mod

Blank Template to add custom Ansible roles to Saltbox.

How to use this template

  1. Install this repo:

    git clone https://github.com/titooo7/saltbox_mod.git /opt/saltbox_mod

    or alternatively :

    sb install saltbox_mod
  2. CD into the saltbox_mod folder:

    cd /opt/saltbox_mod
  3. Create folders for the Ansible role:

    mkdir -p /opt/saltbox_mod/roles/newrole/tasks/
  4. Place the task file there:

    touch /opt/saltbox_mod/roles/newrole/tasks/main.yml
  5. Add custom variables into settings.yml:

    /opt/saltbox_mod/settings.yml
    
  6. Add the Ansible role to saltbox_mod.yml:

    To edit:

    nano /opt/saltbox_mod/saltbox_mod.yml

    Add the following line under roles::

        - { role: newrole, tags: ['newrole'] }

    Final result:

    ---
    - hosts: localhost
    vars_files:
        - settings.yml
        - ['/srv/git/saltbox/accounts.yml', '/srv/git/saltbox/defaults/accounts.yml.default']
        - ['/srv/git/saltbox/settings.yml', '/srv/git/saltbox/defaults/settings.yml.default']
        - ['/srv/git/saltbox/adv_settings.yml', '/srv/git/saltbox/defaults/adv_settings.yml.default']
    roles:
        - { role: pre_tasks }
        - { role: myrole, tags: ['myrole'] }
        - { role: newrole, tags: ['newrole'] }

    Note: The pre_tasks role is required and should not be removed.

  7. Run the Ansible role:

    sudo ansible-playbook saltbox_mod.yml --tags newrole

Step 3 to 5 can be simplified by using the helloworld role as a template. It should be usable without to much modification for most webapp that use a single web port.

cp -r /opt/saltbox_mod/roles/helloworld /opt/saltbox_mod/roles/newrole
sed -i 's/helloworld/newrole/g' /opt/saltbox_mod/roles/defaults/main.yml

then edit the defaults settings.

nano /opt/saltbox_mod/roles/newrole/tasks/main.yml

At the very minimum, you may expect to update the following variables:

newrole_web_port:
newrole_docker_image:
newrole_docker_envs_default:
newrole_docker_volumes_default:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%