Skip to content

Instantly share code, notes, and snippets.

@richm
Last active July 20, 2020 17:57
Show Gist options
  • Save richm/6cdfb5795d3aa468247ee9b44a9f7de0 to your computer and use it in GitHub Desktop.
Save richm/6cdfb5795d3aa468247ee9b44a9f7de0 to your computer and use it in GitHub Desktop.
---
- hosts: node.example.com
become: true
tasks:
- name: Copy client key for 802.1x authentication
copy:
src: "/srv/data/client.key"
dest: "/etc/pki/tls/private/client.key"
mode: 0600
- name: Copy client certificate for 802.1x authentication
copy:
src: "/srv/data/client.crt"
dest: "/etc/pki/tls/certs/client.crt"
- name: Copy CA certificate for 802.1x authentication
copy:
src: "/srv/data/ca.crt"
dest: "/etc/pki/ca-trust/source/anchors/ca.crt"
- include_role:
name: linux-system-roles.network
vars:
network_connections:
- name: enp1s0
type: ethernet
autoconnect: yes
ip:
address:
- 192.0.2.1/24
- 2001:db8:1::1/64
gateway4: 192.0.2.1
gateway6: 2001:db8:1::fffe
dns:
- 192.0.2.200
- 2001:db8:1::ffbb
dns_search:
- example.com
ieee802_1x:
identity: user_name
eap: tls
private_key: "/etc/pki/tls/private/client.key"
private_key_password: "password"
client_cert: "/etc/pki/tls/certs/client.crt"
ca_cert: "/etc/pki/ca-trust/source/anchors/ca.crt"
domain_suffix_match: example.com
state: up
@richm
Copy link
Author

richm commented Jul 20, 2020

Skip to content
All gists
Back to GitHub
@richm
@richm
richm/
gist:6cdfb5795d3aa468247ee9b44a9f7de0
Created now

0

Code
Revisions 1
gistfile1.txt

  • hosts: node.example.com
    become: true
    tasks:
    • name: Copy client key for 802.1x authentication
      copy:
      src: "/srv/data/client.key"
      dest: "/etc/pki/tls/private/client.key"
      mode: 0600

    • name: Copy client certificate for 802.1x authentication
      copy:
      src: "/srv/data/client.crt"
      dest: "/etc/pki/tls/certs/client.crt"

    • name: Copy CA certificate for 802.1x authentication
      copy:
      src: "/srv/data/ca.crt"
      dest: "/etc/pki/ca-trust/source/anchors/ca.crt"

    • include_role:
      name: linux-system-roles.network
      vars:
      network_connections:
      - name: enp1s0
      type: ethernet
      autoconnect: yes
      ip:
      address:
      - 192.0.2.1/24
      - 2001:db8:1::1/64
      gateway4: 192.0.2.1
      gateway6: 2001:db8:1::fffe
      dns:
      - 192.0.2.200
      - 2001:db8:1::ffbb
      dns_search:
      - example.com
      ieee802_1x:
      identity: user_name
      eap: tls
      private_key: "/etc/pki/tls/private/client.key"
      private_key_password: "password"
      client_cert: "/etc/pki/tls/certs/client.crt"
      ca_cert: "/etc/pki/ca-trust/source/anchors/ca.crt"
      domain_suffix_match: example.com
      state: up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment