/remote_dev

Ansible collection for quickly deploying remote development servers

Primary LanguagePython

Ansible Collection - ctorgalson.remote_dev

Molecule Test

An Ansible collection designed for setting up remote web-dev workstations.

Scenarios

Docksal/mosh/vim/public

At present, the collection demonstrates one scenario: configuring a remote development server based on my current day-to-day development needs, configured as follows:

  • Docksal as a development LAMP environment,
  • mosh for stable roaming ssh connection,
  • vim: for editing code directly on the remote server,
  • clamav: for automated antivirus scanning,
  • iptables: for firewalling the server,
  • glances: for a nice, command-line system monitor.

The default server configuration is fully firewalled execpt for ports for:

  • http,
  • https,
  • mosh,
  • ntp,
  • ssh.

When run, the scenario's playbook will create a connection script that starts one of ssh or mosh with the right credentials and connection information.

Using the collection

  • Install the collection. Note: installing the collection via ansible-galaxy hasn't been tested, and I can't guarantee yet that it works. If it doesn't, the collection will have to be installed manually.
  • Create a new Ansible project including an inventory file,
  • Copy the playbook for the scenario that most closely matches your use case from the collection's playbooks/ directory into your project,
  • Copy the playbooks/group_vars/ files for the scenario matching the playbook into your projects' group_vars/all/ directory,
  • Customize the tasks in the playbook to suit your use case,
  • Customize the variables files in group_vars/all/ to suit your use case,
  • Run the playbooks to provision your server,
  • Connect to your newly-provisioned server with the auto-generated connection script.

This will look approximately like this:

ansible-galaxy collection install ctorgalson.remote_dev --pre
mkdir ~/myproject
cd ~/myproject
touch hosts.yml
# (Customize hosts.yml inventory file)
copy -R ~/.ansible/collections/ansible_collections/ctorgalson/remote_dev/playbooks/demo__docksal_mosh_vim_public.yml provision.yml .
mkdir -p group_vars/all
cp -R ~/.ansible/collections/ansible_collections/ctorgalson/remote_dev/playbooks/group_vars/docksal_mosh_vim_public/* ./group_vars/all/
# (Customize playbook)
# (Customize group_vars/all/*.yml)
ansible-playbook -i inventory.yml provision.yml
./redev.sh

Roles

The collection uses numerous roles as submodules. Where possible, I've used my own, but most of them are widely-used roles published in the Ansible community. In alphabetical order by namespace/role-name, the collection's roles are: