updated to support multiple architectures
This commit is contained in:
parent
ab540c9090
commit
683a3446f0
@ -1,22 +1,15 @@
|
|||||||
---
|
---
|
||||||
- name: Copy Package to host
|
- name: copy binaries
|
||||||
copy:
|
copy:
|
||||||
src: files/{{ item }}
|
src: "{{ item.src }}"
|
||||||
dest: "/opt/ansiblepackages/{{ item }}"
|
dest: "{{ item.dst }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0600'
|
mode: '0755'
|
||||||
backup: yes
|
backup: yes
|
||||||
with_items:
|
with_items:
|
||||||
- step-cli_0.15.16_amd64.deb
|
- { src: "files/step/step_0.15.16/{{ ansible_architecture }}/bin/step", dst: "/bin/step" }
|
||||||
- step-ca_0.15.15_amd64.deb
|
- { src: "files/step-ca/step-ca_0.15.15/{{ ansible_architecture }}/bin/step-ca", dst: "/bin/step-ca" }
|
||||||
|
|
||||||
- name: install package
|
|
||||||
apt:
|
|
||||||
deb: "/opt/ansiblepackages/{{ item }}"
|
|
||||||
with_items:
|
|
||||||
- step-cli_0.15.16_amd64.deb
|
|
||||||
- step-ca_0.15.15_amd64.deb
|
|
||||||
|
|
||||||
- name: create user for step-ca
|
- name: create user for step-ca
|
||||||
user:
|
user:
|
||||||
@ -42,7 +35,7 @@
|
|||||||
dest: ~/.step
|
dest: ~/.step
|
||||||
|
|
||||||
- name: init step-ca
|
- name: init step-ca
|
||||||
command: step ca init --name="{{ pki_name }}" --dns {{ ansible_hostname }} --issuer="{{ pki_name }}" --address=:4343 --provisioner="{{ pki_name }}" --password-file=/etc/step-ca/password.txt --provisioner-password-file=/etc/step-ca/password.txt
|
command: step ca init -ssh --name="{{ pki_name }}" --dns {{ ansible_hostname }} --issuer="{{ pki_name }}" --address=:4343 --provisioner="{{ pki_name }}" --password-file=/etc/step-ca/password.txt --provisioner-password-file=/etc/step-ca/password.txt
|
||||||
args:
|
args:
|
||||||
creates: /etc/step-ca/config
|
creates: /etc/step-ca/config
|
||||||
|
|
||||||
@ -95,18 +88,32 @@
|
|||||||
- name: Flush handlers
|
- name: Flush handlers
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
- name: list provisioners
|
- name: check for acme privisioner
|
||||||
command: step ca provisioner list
|
lineinfile:
|
||||||
register: povisionerlist
|
path: /etc/step-ca/config/ca.json
|
||||||
|
regexp: '.*"type": "ACME",.*'
|
||||||
|
line: "{{'\t'}}{{'\t'}}{{'\t'}}{{'\t'}}\"type\": \"ACME\","
|
||||||
|
state: present
|
||||||
|
check_mode: yes
|
||||||
|
register: acmepresent
|
||||||
|
|
||||||
- name: add acme provisioner
|
- name: add acme provisioner
|
||||||
command: step ca provisioner add acme --type ACME
|
command: step ca provisioner add acme --type ACME
|
||||||
when: not povisionerlist.stdout.find ("ACME") != -1
|
when: acmepresent is changed
|
||||||
notify:
|
notify:
|
||||||
- restart step-ca
|
- restart step-ca
|
||||||
|
|
||||||
|
- name: check for default JWK privisioner
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/step-ca/config/ca.json
|
||||||
|
regexp: '.*"type": "JWK",.*'
|
||||||
|
line: "{{'\t'}}{{'\t'}}{{'\t'}}{{'\t'}}\"type\": \"JWK\","
|
||||||
|
state: present
|
||||||
|
check_mode: yes
|
||||||
|
register: jwkpresent
|
||||||
|
|
||||||
- name: remove jwk provisioner
|
- name: remove jwk provisioner
|
||||||
command: step ca provisioner remove "{{ pki_name }}" --type JWK
|
command: step ca provisioner remove "{{ pki_name }}" --type JWK
|
||||||
when: povisionerlist.stdout.find ("JWK") != -1
|
when: jwkpresent is not changed
|
||||||
notify:
|
notify:
|
||||||
- restart step-ca
|
- restart step-ca
|
Loading…
Reference in New Issue
Block a user