Skip to content

Cloudbox/cloudbox_mod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudbox_mod

Blank Template to add custom Ansible roles to Cloudbox.

How to use this template

  1. Clone this repo:

    git clone https://github.com/Cloudbox/cloudbox_mod.git ~/cloudbox_mod
  2. CD into the cloudbox_mod folder:

    cd ~/cloudbox_mod
  3. If you have an Ansible vault password file, add the location to ansible.cfg:

    To edit:

    nano ~/cloudbox_mod/ansible.cfg

    Add line (with path to your vault password file):

    vault_password_file = ~/.ansible_vault

    Final result:

    [defaults]
    inventory = ~/cloudbox/inventories/local
    callback_whitelist = profile_tasks
    command_warnings = False
    retry_files_enabled = False
    hash_behaviour = merge
    role_path = ~/cloudbox/roles
    vault_password_file = ~/.ansible_vault
  4. Create folders for the Ansible role:

    mkdir -p ~/cloudbox_mod/roles/newrole/tasks/
  5. Place the task file there:

    touch ~/cloudbox_mod/roles/newrole/tasks/main.yml
  6. Add custom variables into settings.yml:

    ~/cloudbox_mod/settings.yml
    
  7. Add the Ansible role to cloudbox_mod.yml:

    To edit:

    nano ~/cloudbox_mod/cloudbox_mod.yml

    Add the following line under roles::

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

    Final result:

    ---
    - hosts: localhost
      vars_files:
        - settings.yml
        - ['~/cloudbox/accounts.yml', '~/cloudbox/accounts.yml.default']
        - ['~/cloudbox/settings.yml', '~/cloudbox/settings.yml.default']
        - ['~/cloudbox/adv_settings.yml', '~/cloudbox/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.

  8. Run the Ansible role:

    sudo ansible-playbook cloudbox_mod.yml --tags newrole

About

Blank Template to add custom Ansible role to Cloudbox.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published