You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.3 KiB
YAML
67 lines
1.3 KiB
YAML
# issue #338: ensure /etc/environment is reloaded if it changes.
|
|
# Actually this test uses ~/.pam_environment, which is using the same logic,
|
|
# but less likely to brick a development workstation
|
|
|
|
- name: integration/runner/etc_environment.yml
|
|
hosts: test-targets
|
|
any_errors_fatal: true
|
|
gather_facts: true
|
|
tasks:
|
|
- meta: end_play
|
|
when: ansible_virtualization_type != "docker"
|
|
|
|
|
|
# ~/.pam_environment
|
|
|
|
- file:
|
|
path: ~/.pam_environment
|
|
state: absent
|
|
|
|
- shell: echo $MAGIC_NEW_ENV
|
|
register: echo
|
|
|
|
- assert:
|
|
that: echo.stdout == ""
|
|
|
|
- copy:
|
|
dest: ~/.pam_environment
|
|
content: |
|
|
MAGIC_NEW_ENV=321
|
|
|
|
- shell: echo $MAGIC_NEW_ENV
|
|
register: echo
|
|
|
|
- assert:
|
|
that: echo.stdout == "321"
|
|
|
|
- file:
|
|
path: ~/.pam_environment
|
|
state: absent
|
|
|
|
# /etc/environment
|
|
|
|
- file:
|
|
path: /etc/environment
|
|
state: absent
|
|
|
|
- shell: echo $MAGIC_ETC_ENV
|
|
register: echo
|
|
|
|
- assert:
|
|
that: echo.stdout == ""
|
|
|
|
- copy:
|
|
dest: /etc/environment
|
|
content: |
|
|
MAGIC_ETC_ENV=555
|
|
|
|
- shell: echo $MAGIC_ENV_ENV
|
|
register: echo
|
|
|
|
- assert:
|
|
that: echo.stdout == "555"
|
|
|
|
- file:
|
|
path: /etc/environment
|
|
state: absent
|