Browse Source

remove host.crt/host.key before resigning in the vagrant test environment

Alan Lam 5 years ago
parent
commit
97ccfd2413
1 changed files with 6 additions and 0 deletions
  1. 6 0
      examples/quickstart-vagrant/ansible/roles/nebula/tasks/main.yml

+ 6 - 0
examples/quickstart-vagrant/ansible/roles/nebula/tasks/main.yml

@@ -22,6 +22,12 @@
     - vagrant-test-ca.key
     - vagrant-test-ca.key
     - vagrant-test-ca.crt
     - vagrant-test-ca.crt
 
 
+- name: remove previously signed host certificate
+  file: dest=/etc/nebula/{{ item }} state=absent
+  with_items:
+    - host.crt
+    - host.key
+
 - name: sign using the root key
 - name: sign using the root key
   command: nebula-cert sign -ca-crt /opt/vagrant-test-ca.crt -ca-key /opt/vagrant-test-ca.key -duration 4320h -groups vagrant -ip {{ hostvars[inventory_hostname][vagrant_ifce]['ipv4']['address'] | to_nebula_ip }}/9 -name {{ ansible_hostname }}.nebula -out-crt /etc/nebula/host.crt -out-key /etc/nebula/host.key
   command: nebula-cert sign -ca-crt /opt/vagrant-test-ca.crt -ca-key /opt/vagrant-test-ca.key -duration 4320h -groups vagrant -ip {{ hostvars[inventory_hostname][vagrant_ifce]['ipv4']['address'] | to_nebula_ip }}/9 -name {{ ansible_hostname }}.nebula -out-crt /etc/nebula/host.crt -out-key /etc/nebula/host.key