Skip to content

Commit

Permalink
Merge pull request #3 from epsilon-0/master
Browse files Browse the repository at this point in the history
added install for keepass dependencies
  • Loading branch information
qbit committed Jul 12, 2020
2 parents 08b4f7c + d4dc95a commit 2115913
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ Role Variables
| rw_commit | `master` | Specific commit to be used during the checkout process. |
| rw_env | `production` | Specify if we are running in production or development mode. |
| rw_src | `"{{ rw_home }}/src"` | Dir to clone the rubywarden source to. |
| rw_keepass | `false` | Install gems needed for importing keepass version 1 databases (version 2 is not supported)|

Running rubywarden tool scripts
-------------------------------

The rubywarden scripts are installed in `/var/rubywarden/src/tools/`.

To run the scripts you need to set the proper environment so that the ruby gems installed into the local directory work correctly.

For example, to import a version 1 keepass database:

```
RUBYWARDEN_ENV=production \
PATH=/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/var/rubywarden/rb/bin \
HOME=/var/rubywarden \
GEM_HOME=/var/rubywarden/rb/ruby/2.6 \
ruby26 tools/keepass_import.rb -f /path/to/keepass.kbdx -u <bw-user>@domain.tld
```

Example Playbook
----------------
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ rw_commit: master
rw_env: production
rw_home: /var/rubywarden
rw_src: "{{ rw_home }}/src"
rw_keepass: False

rw_ruby_slug: "{{ rw_ruby | regex_replace('\\.', '') }}"
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
gem_path: "{{ rw_home }}/rb"
binstub_directory: "{{ rw_home }}/rb/bin"
chdir: "{{ rw_src }}"
extra_args: "{% if rw_keepass %}--with keepass{% endif %}"
state: present

- name: make the {{ rw_env }} db dir
Expand Down

0 comments on commit 2115913

Please sign in to comment.