浏览代码

ansible: add comment about set_fact

pull/1/head
10sr 10 年前
父节点
当前提交
572e853db8
共有 1 个文件被更改,包括 10 次插入9 次删除
  1. +10
    -9
      ansible/sshd_config.yml

+ 10
- 9
ansible/sshd_config.yml 查看文件

@@ -1,16 +1,17 @@
---
- 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: find sshd_config
# set_fact: conf={{item}}
# # how to check remote files?
# with_first_found:
# - /etc/ssh/sshd_config
# - /etc/sshd_config
# - name: assert sshd_config found
# assert: that="conf is defined"
- name: Protocol 2
lineinfile: dest={{conf}}
regexp="^(#)?Protocol"


正在加载...
取消
保存