Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

win_environment is not a legal parameter in an Ansible task or handler #2187

Closed
anthonygreen opened this issue Oct 2, 2015 · 3 comments
Closed

Comments

@anthonygreen
Copy link

Issue Type:

Bug Report

Ansible Version:

1.9.3

Ansible Configuration

[defaults]
inventory = ./hosts

Docker.py version

1.2.3

Environment

Running from: OS X 10.9.5
Managing: Windows 10

Summary:

the win_environment module is not available to ansible

Steps to reproduce

This playbook fails

- name: Add selenium drivers lcoation to Windows Path
  win_environment:
    state: present
    name: Path
    value: 'PATH=%PATH%;C:\selenium\'
    level: machine

with the error

ERROR: win_environment is not a legal parameter in an Ansible task or handler
@jhawkesworth
Copy link
Contributor

Hi, This is because win_environment is not available in Ansible 1.9.3. As the docs state 'New in version 2.0.'
You can probably run it by grabbing the win_environment.ps1 file into your ansible configuration's library folder (i.e. if you ansible configuration is in /etc/ansible/ then put the file in /etc/ansible/library

I would be interested to know if you can use 'PATH=%PATH%;C:\selenium' in the value: as I don't recall testing the module using that syntax. If it fails you could fetch the current environment value for path with a script or perhaps replace the entire PATH value with a literal string (depending on what you are trying to achieve this could be a dangerous or desirable thing to do though).

Jon (module author)

@robynbergeron
Copy link

Hi @anthonygreen -- thanks for filing this bug report.

And thanks to @jhawkesworth for the response :)

@anthonygreen -- as noted by @jhawkesworth, this is due to win_environment being new in 2.0. If you have a moment to answer his question above, though, that would be helpful!

Otherwise -- if we don't hear from you in a week or two, we'll go ahead and close this.

@anthonygreen
Copy link
Author

Adding the win_environment.* files does mean I can run the win_environment tasks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants