Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with Ansible 2.0 #24

Open
echo-devnull opened this issue Jan 26, 2016 · 1 comment
Open

Fails with Ansible 2.0 #24

echo-devnull opened this issue Jan 26, 2016 · 1 comment

Comments

@echo-devnull
Copy link

With this error:

TASK [bennojoy.network_interface : Install the required packages in Debian derivatives] ***
[DEPRECATION WARNING]: Using bare variables for environment is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{foo}}'). This feature will be removed in a future release. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [suproxy02.intra.fd.nl]: FAILED! => {"failed": true, "msg": "ERROR! environment must be a dictionary, received env (<class 'ansible.parsing.yaml.objects.AnsibleUnicode'>)"}
@echo-devnull
Copy link
Author

This:

---
- env:
    RUNLEVEL: 1

needs to be:

---
env:
  RUNLEVEL: 1

And since 2.0 we need to quote environment variables:

- name: Install the required  packages in Redhat derivatives
  yum: name='{{ item }}' state=installed
  with_items: network_pkgs
  when: ansible_os_family == 'RedHat'

- name: Install the required packages in Debian derivatives
  apt: name='{{ item }}' state=installed update_cache=yes
  with_items: network_pkgs
  environment: "{{ env }}"
  when: ansible_os_family == 'Debian'

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

No branches or pull requests

1 participant