Files
product-demos/windows/windows_choco_multiple.yml
willtome c18a206499 Merge of RedHatGov/product-demos (#56)
Co-authored-by: MKletz <michael.kletz.27@gmail.com>
Co-authored-by: Ajay Chenampara <ajay.chenampara@gmail.com>
Co-authored-by: dlemons-redhat <69318976+dlemons-redhat@users.noreply.github.com>
Co-authored-by: Nicolas Leiva <nicolasleiva@gmail.com>
Co-authored-by: benblasco <42140583+benblasco@users.noreply.github.com>
Co-authored-by: Benjamin Blasco <bblasco@redhat.com>
Co-authored-by: calvingsmith <4283930+calvingsmith@users.noreply.github.com>
Co-authored-by: Calvin Smith <calvingsmith@users.noreply.github.com>
Co-authored-by: Hicham Mourad <43329991+HichamMourad@users.noreply.github.com>
2023-03-17 09:07:02 -04:00

29 lines
873 B
YAML

---
- name: Chocolatey install multiple
hosts: "{{ _hosts | default('os_windows') }}"
gather_facts: false
vars:
choco_packages:
- name: nodejs
- name: python
tasks:
- name: Install specific versions of packages sequentially
chocolatey.chocolatey.win_chocolatey:
name: "{{ item.name }}"
state: present
loop: "{{ choco_packages }}"
- name: Check python version
ansible.windows.win_command: python --version
register: check_python_version
changed_when: false
- name: Check nodejs version
ansible.windows.win_command: node --version
register: check_node_version
changed_when: false
- name: Print message
ansible.builtin.debug:
msg: Python Version is {{ check_python_version.stdout_lines[0] }} and NodeJS version is {{ check_node_version.stdout_lines[0] }}