Changeset 13851


Ignore:
Timestamp:
25 Apr 2016, 21:44:31 (9 years ago)
Author:
uli
Message:

Merge two host-key tasks into one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup-ansible/bootstrap.yml

    r13850 r13851  
    4444        state=present
    4545
    46     - name: "bootstrap | sshd_config - disable dsa keys"
     46    - name: "bootstrap | sshd_config - disable weak keys"
    4747      lineinfile:
    4848        dest=/etc/ssh/sshd_config
    4949        backrefs=yes
    50         line='# HostKey /etc/ssh/ssh_host_dsa_key'
    51         regexp='^HostKey /etc/ssh/ssh_host_dsa_key'
    52         state=present
    53       notify: "restart sshd"
    54 
    55     - name: "bootstrap | sshd_config - disable ecdsa keys"
    56       lineinfile:
    57         dest=/etc/ssh/sshd_config
    58         backrefs=yes
    59         line='# HostKey /etc/ssh/ssh_host_ecdsa_key'
    60         regexp='^HostKey /etc/ssh/ssh_host_ecdsa_key'
    61         state=present
     50        line={{ item.line }}
     51        regexp={{ item.regexp }}
     52      with_items:
     53        - { regexp: '^HostKey /etc/ssh/ssh_host_dsa_key', line: '# HostKey /etc/ssh/ssh_host_dsa_key' }
     54        - { regexp: '^HostKey /etc/ssh/ssh_host_ecdsa_key', line: '# HostKey /etc/ssh/ssh_host_ecdsa_key' }
    6255      notify: "restart sshd"
    6356
Note: See TracChangeset for help on using the changeset viewer.