Giter VIP home page Giter VIP logo

saltbox_mod's Introduction

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/saltyorg/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:

saltbox_mod's People

Contributors

desimaniac avatar grostim avatar saltydk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.