{"id":18086131,"url":"https://github.com/smashingboxes/taperole","last_synced_at":"2025-04-12T22:36:11.593Z","repository":{"id":22036018,"uuid":"25364300","full_name":"smashingboxes/taperole","owner":"smashingboxes","description":"🕹 Application Server Provisioning and Deployment with Ansible","archived":false,"fork":false,"pushed_at":"2018-10-17T18:28:07.000Z","size":753,"stargazers_count":9,"open_issues_count":15,"forks_count":7,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-04-25T20:02:50.221Z","etag":null,"topics":["ansible","deployment","devops","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smashingboxes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-17T15:24:41.000Z","updated_at":"2022-06-10T12:30:08.000Z","dependencies_parsed_at":"2022-08-18T17:50:38.233Z","dependency_job_id":null,"html_url":"https://github.com/smashingboxes/taperole","commit_stats":null,"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashingboxes%2Ftaperole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashingboxes%2Ftaperole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashingboxes%2Ftaperole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashingboxes%2Ftaperole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smashingboxes","download_url":"https://codeload.github.com/smashingboxes/taperole/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642736,"owners_count":21138352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","deployment","devops","rails","ruby"],"created_at":"2024-10-31T16:06:42.183Z","updated_at":"2025-04-12T22:36:11.565Z","avatar_url":"https://github.com/smashingboxes.png","language":"Ruby","readme":"[![Build Status](https://travis-ci.org/smashingboxes/taperole.svg?branch=master)](https://travis-ci.org/smashingboxes/taperole)\n[![Stories in Ready](https://badge.waffle.io/smashingboxes/taperole.png?label=ready\u0026title=Ready)](https://waffle.io/smashingboxes/tape)\n# Infrastructure Management\n\n## Deploying \u0026 provisioning with tape\n**Use Unbuntu trusty64 (16 x64)**\n\n**Enable ssh access via root user**\n\nFor a tutorial on getting started: [Taperole: the Smashing Boxes Way to Deploy Your Rails App](http://smashingboxes.com/blog/taperole-the-smashing-boxes-way-to-deploy-your-rails-app)\n\n### Basics\n\n**Install**\n\n*Deprecation notice*: As of taperole 1.7, support for Ubuntu 14.x has been deprecated. If your server does not use Ubuntu 16.x, please install taperole 1.6.0 instead.\n\n* `$ gem install taperole` or add `gem 'taperole', '~\u003e1.7'` to your Gemfile\n* `$ brew install ansible`\n* Create a [Digital Ocean Droplet](https://www.digitalocean.com/) (or any Ubuntu 16.04 system with ssh access)\n* Run `tape installer install` in project repo\n* Update your hosts file with the IP address of your server (this can be found in your Droplet). If you go down to \"Multistage\", you'll see an excellent example of what your hosts file should look like.\n* Fill in missing values in `tape_vars.yml`. Should look something like this:\n\n```yaml\napp_name: [app name]\nbe_app_repo: [git repo]\n```\n\n* Copy all developers' public keys into the `taperole/dev_keys` directory.\n* Use `$ tape ansible provision` for your first deploy, then `$ tape ansible deploy` for subsequent changes.\n\n**Upgrade**\n\n**NOTE**: Upgrading tape on a machine is only supported for patch versions (ie 1.3.0 to 1.3.1). For minor or major versions, it is advised that you stand up a new box, and start from stratch.\n\n```bash\nbundle update taperole\ntape installer install\n```\n\n### Configuration\n\nAll default configurations found in `vars/defaults.yml` can be overridden in your local `taperole/tape_vars.yml` file\n\n**Default Node Version**: 8.x\n**Default Ruby Version** 2.4.0\n\n### Backups\nBackups are handled via [duply](http://duply.net/) and are configured via the [Stouts.backup](https://github.com/Stouts/Stouts.backup) ansible galaxy role. Bacups occur every night at 4am under the root user. You can configure your backup schedule and target where you want your backups stored at within your `taperole/tape_vars.yml` file.\n\nThe default location for backups is the `/var/lib/postgresql/backups` directory.\n\nAll servers in your [production] group will have backups enabled by default.\n\nDetailed configurations can be made in your tape_vars.yml file.\n\n```\n# Store Backups on S3\nbackup_dir: s3+http://[aws_access_key:aws_secret_access_key]@bucket_name[/folder]\n\n# Store Backups on Seperate server via rsync\nbackup_dir: s3+http://[aws_access_key:aws_secret_access_key]@bucket_name[/folder]\n\n# Adjust Cron Job Schedule (default is every night at 4am)\nbackup_schedule: \"* */4 * * *\"\n\n# Change Which Servers are backed up\nbackup_hosts:\n  - production\n  - staging\n  - qa\n```\n\n### Custom roles\nYou can add app specific ansible roles to `\u003capp_root\u003e/roles`.\n\nYou must then specify the roles you want to use in `provision.yml` or `deploy.yml`\n\n[Read the Ansible docs on playbook roles here](http://docs.ansible.com/playbooks_roles.html)\n\n### Multistage (environments)\nYou can setup multistage by defining your hosts file as follows\n\n```\n[production]\n0.0.0.0 be_app_env=production be_app_branch=SOME_BRANCH\n\n[staging]\n0.0.0.0 be_app_env=staging be_app_branch=SOME_BRANCH\n\n[omnibox:children]\nproduction\nstaging\n```\n\nThen use the `-l` option to specify the stage/environment\n\n```sh\ntape ansible deploy -l staging\n```\n\n### Configure LetsEncrypt\nAs of 2.0, Tape can automatically configure HTTPS with LetsEncrypt\nYou will need to set the following configs:\n\nIn your `hosts` file add a hostname variable\n```\n[production]\n0.0.0.0 be_app_env=production be_app_branch=SOME_BRANCH hostname=project-production.example.com\n\n[staging]\n0.0.0.0 be_app_env=staging be_app_branch=SOME_BRANCH hostname=project-staging.example.com\n```\n\nIn your `tape_vars.yml`\n```\nletsencrypt:\n  enabled: true\n  hostname: \"{{hostname}}\"\n  email: some_email@example.com\n```\n\n## Testing\n### With vagrant\n\n1. `echo 'y' | tape installer install`\n1. `vagrant up`\n2. Put the following into your [hosts inventory file](http://docs.ansible.com/intro_inventory.html):\n\n```\n[vagrant]\nlocalhost:2222 ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key\n```\n\nThe port number might be different if other vagrant machines are running, run `vagrant ssh-config`  to find the correct configuration.\nYou can specify a port using the `ansible_ssh_port` in your hosts inventory file.\n\n3. Update `tape_vars.yml` with information to a rails app you want to deploy\n4. `tape ansible provision -l vagrant`\n\n### With Docker\n1. Setup your machine to work with Docker. We recommend [Docker Machine](https://docs.docker.com/machine/)\n\n**Test Rails**\n\n2. `docker build -f test/rails/Dockerfile -t tapetest .`\n3. `docker run -i -t $(docker images -q tapetest) /start_rails.sh | grep \"Hello\"`\n\nIf the last command resulted in a `\u003ch1\u003eHello\u003c/h1\u003e` then your Rails application deployed successfully!\n\n## Development\n\n```sh\ngit clone git@github.com:smashingboxes/taperole.git\ncd taperole\nansible-galaxy install -r requirements.yml --force\n```\n\n## Rails Application Requirements\n\nYour rails application must:\n* use posgres as the database\n* use puma as the app server\n* have access to the taperole gem\n\nUsually, your Gemfile will include something like:\n```\n# Use postgresql as the database\ngem 'pg'\n\n# Use Puma as the app server\ngem 'puma'\n\n# Use taperole for deployment\ngem 'taperole', '~\u003e1.7'\n\n```\n\nNote: You can also `$ gem install taperole` and not put Taperole in your\nGemfile.\n\nDuring your first deploy, your app will not have a `secrets.yml` file configured, and Tape will prompt you to provide one:\n\n```\nTASK: [backend_config | Ask for secrets.yml] **********************************\nok: [159.203.126.223] =\u003e {\n    \"msg\": \"You've got to upload secrets.yml to /home/deployer/kevinrkiley/config to continue\"\n}\n```\n\nTo continue the deploy, SSH into the server as the `deployer` user and create your `config/secrets.yml` file in the app directory. The deploy will automatically continue when the file is saved.\n\n### Rake tasks\n\nTo run ad-hoc rake tasks, you can use the following:\n\n```\ntape ansible rake --task users:rank\n```\n\n## Slack integration\n\nTape includes built-in support for posting messages to slack at the beginning and end of deployments.\n\nHere are the steps needed to enable this functionality:\n\n1. Start by setting up [an incoming webhook integration](https://my.slack.com/services/new/incoming-webhook/)\n2. Add that URL to `tape_vars.yml` as `slack_webhook_url`\n3. Profit.\n\n# Releasing a new version of taperole\n\n1. Bump the version in `lib/taperole/version.rb`\n2. `gem build taperole.gemspec`\n3. `bundle install`\n4. Commit to git, push, and make PR\n5. Wait for approval, and merge\n6. `git checkout master`\n7. `git pull`\n8. `git tag -a VERSION` (e.g. `git tag -a 2.1.0`)\n9. `git push --tags`\n10. `gem push taperole.gemspec` (You'll need access to push the gem on rubygems. Ask Derek for this)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmashingboxes%2Ftaperole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmashingboxes%2Ftaperole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmashingboxes%2Ftaperole/lists"}