OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Ansible - Windows path variable

  • Thread starter Thread starter StevieHyperB
  • Start date Start date
S

StevieHyperB

Guest
Is there away to use variables and string together? For example I would like to, define my path's and other options combining variables and string?

Code:
#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

Sure there is a simple answer but can't find one at the minute
<p>Is there away to use variables and string together? For example I would like to, define my path's and other options combining variables and string?</p>

<pre><code>#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
</code></pre>

<p>Sure there is a simple answer but can't find one at the minute</p>
Continue reading...
 

Latest posts

I
Replies
0
Views
1
Isaac P. Liu
I
U
Replies
0
Views
1
user3658366
U
G
Replies
0
Views
1
Giampaolo Levorato
G
M
Replies
0
Views
1
Marcelo Rodrigo Nascimento
M
Top