-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to configure custom SSL certificate for st2web/nginx #133
Conversation
roles/st2web/tasks/certificate.yml
Outdated
dest: /etc/ssl/st2 | ||
mode: 0700 | ||
|
||
- name: Save custom SSL certificate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@armab This would all be simple if ansible-st2 would allow galaxy imports so we could just use jdauphant's SSL role.
copy: | ||
content: "{{ item.cert }}" | ||
dest: "{{ item.path }}" | ||
mode: 0600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd explicitly set the owner and group just to be clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
Now wondering what user:group should it be.
Hmm, root:root
or something different including mode, example: https://superuser.com/a/556496
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in e442ebf
|
||
- name: Generate self-signed SSL certificate | ||
become: yes | ||
shell: openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/st2/st2.key -out /etc/ssl/st2/st2.crt -days 365 -nodes -subj "/C=US/ST=California/L=Palo Alto/O=StackStorm/OU=Information Technology/CN=$(hostname)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this generate a new cert every time ansible is run? You may want to stat the file and check if the .crt and .key exist before regeneration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has creates
arg below, so should be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Closes #132
Add 2 new vars for
st2web
role:st2web_ssl_certificate
andst2web_ssl_certificate_key
.If both vars are provided, - save the cert. If not provided, - generate self-signed certificate as it was before.
The default behavior remains as before: generting self-signed cert for
st2web
UI,Example usage
TODO