Skip to content

Commit

Permalink
Added automatic ssl certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
onnimonni committed Mar 7, 2016
1 parent 18416fd commit b667391
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
29 changes: 26 additions & 3 deletions ansible/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

vars:
dev_env_dir: /usr/local/gdev-env
gdev_user_files: "{{ansible_env.HOME}}/.gdev"

tasks:

- name: Check Sudo Password
command: ls
command: "echo 'sudo works'"
become: yes
become_method: sudo

Expand Down Expand Up @@ -44,8 +45,11 @@
become: yes
become_method: sudo

- name: Give machine some time to start
pause: seconds=30
- name: Wait for machine to start
wait_for:
path: "/var/run/docker.sock"
state: present
timeout: 30

- name: Get machine ip address
shell: "{{ dev_env_dir }}/bin/gdev machine ip"
Expand All @@ -55,6 +59,25 @@
debug:
msg: "Dlite is up and running: {{ machine_ip.stdout }}"

- name: Start gdev services
command: "{{ dev_env_dir }}/bin/gdev service up"

- name: Wait for signaler to create CA file
wait_for:
path: "{{ gdev_user_files }}/ca/ca.crt"
state: present
timeout: 30


# This only works in OS X and doesn't affect firefox
# We want to use https locally and you only use ca.key which is generated to you
- name: Trust self-generated signaler Root certificate in keychain
shell: "security add-trusted-cert -d -r trustRoot -k '/Library/Keychains/System.keychain' ca.crt"
args:
chdir: "{{ gdev_user_files }}/ca/"
become: yes
become_method: sudo

- name: Create resolver directory
file: path=/etc/resolver state=directory mode=0755
become: yes
Expand Down
2 changes: 1 addition & 1 deletion bin/gdev
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ HEREDOC
end

def update(args)
system('cd /usr/local/gdev-env && git fetch && git reset --hard origin/master')
#system('cd /usr/local/gdev-env && git fetch && git reset --hard origin/master')
system('ansible-playbook /usr/local/gdev-env/ansible/mac.yml -i 127.0.0.1, --ask-become-pass --verbose')
end

Expand Down

0 comments on commit b667391

Please sign in to comment.