Skip to content

Commit

Permalink
Merge pull request #128 from curationexperts/cap_updates
Browse files Browse the repository at this point in the history
Update capistrano_setup and simplify first_deploy
  • Loading branch information
mlooney authored Oct 25, 2021
2 parents b9aae20 + b2883e4 commit 8552d24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 0 additions & 7 deletions roles/capistrano_setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,3 @@
groups: deploy
append: yes

- name: "create capistrano skeleton"
become: yes
file: path=/opt/{{ project_name }}/{{ item }} owner=deploy group=deploy state=directory
loop:
- releases
- repo
- shared/config
11 changes: 10 additions & 1 deletion roles/first_deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
path: /home/{{ ansible_ssh_user }}/.ssh/known_hosts
state: absent

- name: "create shared project directory"
become: yes
file: path=/opt/{{ project_name }} owner=deploy group=deploy state=directory

- name: generate rails secret
command: openssl rand -hex 64
register: rails_secret
Expand Down Expand Up @@ -102,6 +106,12 @@
shell: gem install bundler -v "{{ bundler_version }}"
when: bundler_preinstalled.failed

- name: install gems (bundle install)
become: yes
shell: bundle install
args:
chdir: /home/{{ ansible_ssh_user }}/{{ project_name }}

# Set up a keypair so the ansible user can connect as the capistrano deploy user
- name: create deployment keypair for connection user
user:
Expand All @@ -120,7 +130,6 @@
user: deploy
key: "{{ public_key.content | b64decode }}"


- name: ensure ansible user is in the deploy group
become: yes
user:
Expand Down

0 comments on commit 8552d24

Please sign in to comment.