【发布时间】:2019-05-07 12:31:59
【问题描述】:
是否可以同时使用变量和字符串?例如,我想定义我的路径和其他结合变量和字符串的选项?
#Add Directory
- name: Add Directory
win_file:
path: "{{directory_path}}\AppName-{{env}}"
state: directory
#Add IUSR to directory path
- name: ADD IUSR
win_acl:
path: "{{directory_path}}\AppName-{{env}}"
user: IUSR
rights: Read
type: allow
state: present
propagation: 'NoPropagateInherit'
#Add website
- name: "{{env}} Add App Name"
win_iis_website:
name: "AppName-{{env}}"
state: started
port: 80
ip: "{{serverip}}"
hostname: "appname-{{env}}.com"
application_pool: "{{application_pool4}}"
physical_path: "{{directory_path}}\AppName-{{env}}"
register: website
当然有一个简单的答案,但一时找不到
【问题讨论】:
-
您必须引用 Windows 路径分隔符。