Skip to content

Instantly share code, notes, and snippets.

@rstarmer
Created January 5, 2016 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rstarmer/7e3a2b67037f5c963890 to your computer and use it in GitHub Desktop.
Save rstarmer/7e3a2b67037f5c963890 to your computer and use it in GitHub Desktop.
Additional tasks for enabling travisci's public key for remote ssh updates.
- name: Get project from git
git: clone=yes dest=/var/www/ruby_hw repo=https://github.com/rstarmer/ruby_hw version=travisci
- name: Ensure .ssh director for web user
file: state=directory owner=web recurse=yes path=/home/web/.ssh mode=0700
- name: Add ssh public key for travis-CI deployment
shell: cat /var/www/ruby_hw/travis.pub >> /home/web/.ssh/authorized_keys
- name: Ensure authroized_keys for web user
file: state=file owner=web path=/home/web/.ssh/authorized_keys mode=0600
- name: change directory ownership
file: owner=web recurse=yes path=/var/www/ruby_hw
notify:
- reload apache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment