Преглед на файлове

use set_fact for finding sshd_config

pull/1/head
10sr преди 10 години
родител
ревизия
c5e2407086
променени са 1 файла, в които са добавени 9 реда и са изтрити 2 реда
  1. +9
    -2
      ansible/sshd_config.yml

+ 9
- 2
ansible/sshd_config.yml Целия файл

@@ -1,9 +1,16 @@
---
- hosts: all
vars:
conf: /etc/ssh/sshd_config
# vars:
# conf: /etc/ssh/sshd_config
sudo: yes
tasks:
- name: find sshd_config
set_fact: conf={{item}}
with_first_found:
- /etc/ssh/sshd_config
- /etc/sshd_config
- name: assert sshd_config found
assert: conf is defined
- name: Protocol 2
lineinfile: dest={{conf}}
regexp="^(#)?Protocol"


Зареждане…
Отказ
Запис