• This repository has been archived on 26/Apr/2020
  • Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
  • License
    BSD 2-Clause "Sim...
  • Created almost 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate and/or deploy SSL certificate

ansible-role-ssl-certs

@jdauphant : I don't have time to manage anymore this role. Don't hesitate to fork and made your own version.

Generate and/or deploy SSL certificate

Available on Ansible Galaxy: jdauphant.ssl-certs

Examples

Example to generate a self-signed SSL certificate

 - hosts: all
   roles:
     - jdauphant.ssl-certs

This will create certificate and private key in:

  • /etc/ssl/myserver.mydomain.com.key
  • /etc/ssl/myserver.mydomain.com.pem

Example to deploy a SSL certificate

 - hosts: all
   roles:
    - role: jdauphant.ssl-certs
      ssl_certs_common_name: "example.com"

The certificate has to be placed in files/ssl/example.com.key and files/ssl/example.com.pem. If they don't exist, the key and a self-signed certificate will be generated at /etc/ssl/example.com/example.com.key and /etc/ssl/example.com/example.com.pem using the provided common name.

Example to deploy a SSL certificate using local key/pem files

 - hosts: all
   roles:
    - role: jdauphant.ssl-certs
      ssl_certs_local_privkey_path: '/path/to/example.com.key'
      ssl_certs_local_cert_path: '/path/to/example.com.pem'

Example to deploy a SSL certificate stored in variables

An SSL certificate and key are just text that can be stored as a variable, which is useful when using ansible vault.

Example variable data, note how the text blob is indented. This is needed to correctly insert the text via the template module.

ssl_certs_local_privkey_data: |
  -----BEGIN RSA PRIVATE KEY-----
  MIIEpQIBAAKCAQEAu2uhv2cjoN4F3arUZ5cDrwuxf3koCwrKSK75as0WZoxYrpyw
  Lyx9ldyD4nGabVep0R/uAgQ/HqEf2jC7WIvGcEq8bHB9PyEEWzT8IjKQX0YTc//4
  gkHBkpyU0fVrj5nkc30EIbcbH4RHRDwye4VhP/iCPchDG7OqvCyOdm8=
  -----END RSA PRIVATE KEY-----
ssl_certs_local_cert_data: |
  -----BEGIN CERTIFICATE-----
  MIIDmzCCAoOgAwIBAgIJAKWMlgLwrBzXMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV
  QAL3naEfBSZBl0tBohuxn8Xd3yLPuKGUOk3pSL1IJy0Ca6p+QwjkaZUd9X3gf1V2
  SEfYSaGPvfIlSuHIshno
  -----END CERTIFICATE-----

Then simply include the role as in the first example.

Example to use this role with my Nginx role: jdauphant.nginx

 - hosts: all
   roles:
     - role: jdauphant.ssl-certs
       ssl_certs_generate_dh_param: true
     - role: jdauphant.nginx
       nginx_configs:
          ssl:
               - ssl_certificate_key {{ssl_certs_privkey_path}}
               - ssl_certificate     {{ssl_certs_cert_path}}
               - ssl_dhparam         {{ssl_certs_dhparam_path}}
       nginx_sites:
          default:
               - listen 443 ssl
               - server_name _
               - root "/usr/share/nginx/html"
               - index index.html

More Repositories

1

awesome-ansible

A collaborative curated list of awesome Ansible resources
979
star
2

ansible-role-nginx

Ansible role to install and manage nginx configuration
Jinja
653
star
3

ansible-freebsd-playbooks

Playbook example for FreeBSD
Python
82
star
4

ansible-role-dns

Ansible host for configure DNS
33
star
5

ansible-role-unbound

Ansible role for Unbound DNS Server and resolver
Jinja
32
star
6

ansible-role-ssh-config

Generate a ~/.ssh/config with your inventory
22
star
7

ansible-role-vagrant

Install vagrant with Ansible
19
star
8

patch-openssl-CVE-2014-0160

Patch openssl #heartbleed with ansible
19
star
9

ansible-ubuntu-desktop

Provision an custom Ubuntu Desktop with Ansible
Shell
19
star
10

ansible-role-kvm

Ansible role to install a KVM host server and launch KVM VMs
13
star
11

awesome-playframework

A collaborative curated list of awesome Play Framework resources from the last version
10
star
12

ansible-variables-precedence

Example to understand variables precedence of Ansible
9
star
13

ansible-role-intellij

Ansible role to install IntelliJ IDEA Community Edition
Shell
9
star
14

awesome-scalingo

A collaborative curated list of awesome Scalingo resources
8
star
15

ansible-role-sublimetext

Install sublime text with ansible
7
star
16

ansible-playbook-vmwaretools

Install vmware tools
7
star
17

ansible-role-spark

Ansible role to manage Spark from the official github
Shell
5
star
18

ansible-role-dropbox

Role to manage dropbox installation
5
star
19

ansible-syntax-examples

Simple or advance syntax examples for ansible
Shell
5
star
20

ansible-role-scala

Ansible role to install sbt and scala
4
star
21

ansible-role-packaging

Ansible role for manage packaging operation (Default package, repository, proxy ...)
4
star
22

ansible-role-atom

Ansible role to install atom editor
4
star
23

ansible-role-gsutil

Install and setup gsutil with Ansible
4
star
24

ansible-role-postfix

Ansible for manage Postfix
4
star
25

packer-ubuntu-kvm-ansible

Create an Ubuntu KVM image with packer and ansible
4
star
26

ansible-role-skeleton

Skeleton for a Ansible Role
Shell
3
star
27

ansible-role-network

Ansible role for network configuration
2
star
28

invite-codes

We used this to create cards with unique invite codes on them, printed them via moo.com.
Python
2
star
29

ansible-role-sudo

Configure Sudo with Ansible
2
star
30

ansible-role-tinyproxy

Ansible host for configure Tinyproxy
2
star
31

ansible-role-docker

Ansible role to manage docker
2
star
32

ansible-role-policies

Base policy
2
star
33

ansible-role-maven

Ansible role to manage maven
2
star
34

ansible-role-playframework

Ansible role to manage Play Framework
Shell
2
star
35

ansible-role-spotify

Role that install spotify with ansible
1
star
36

ansible-roles

Regroupment of all my Ansible roles with git submodule + Informations
1
star
37

iOS-Velib

Yet Another iOS Velib Application
Swift
1
star
38

ansible-role-dell-printers

Role that manage dell printer with Ansible
1
star
39

ansible-role-brother

Install driver for the brother printers and scanner
1
star
40

patch-bash-shellshock

Patch bash #shellshock with ansible
1
star
41

ansible-patch-ssl3-poodle

Ansible playbook to remove support of ssl3 from browser
1
star
42

ansible-role-gnome-shell

Role that install gnome-shell with Ansible
1
star
43

ansible-role-privoxy

Ansible role to install the proxy server privoxy.
1
star
44

play-akka-demo

Demo usage of play with akka actor
Scala
1
star
45

ansible-role-monit

Ansible Role for Monit
1
star
46

changelocalproxy_macos

Program and install script for change proxy to a local one without admin rights
C
1
star
47

mixpanel-qt

Qt library for mixpanel
C++
1
star
48

play_api_example

Example of API with play framework 2.3 that use mongodb
Scala
1
star
49

awesome-reactivecocoa

Example and Tools around Reactive Cocoa
1
star
50

reactive-velib-api

Reactive Velib WebAPI
Scala
1
star
51

ansible-role-limits

Ansible to setup system limits
1
star