Ansible/playbook/linux/InstallPowerShellCore.yml
James Tombleson b504748e0d fixed pwsh deploy
updated hosts template to support sudo password field
2019-04-15 15:19:23 -07:00

35 lines
870 B
YAML

- name: Install PowerShell Core
hosts: linux
#debugger: always
tasks:
- name: Check if PowerShell is installed
failed_when: "'Failed' PowerShell is already installed."
apt:
name: powershell
- name: Install Microsoft GPG Key
get_url:
url: https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
dest: /tmp/
- name: Register GPG Key
become: true
become_method: sudo
apt: deb="/tmp/packages-microsoft-prod.deb"
#command: dpkg -i ~/packages-microsoft-prod.deb
- name: Update repos and Install PowerShell Core
become: true
become_method: sudo
apt:
name: powershell
update_cache: yes
state: present
- name: Remove Extra files
file:
state: absent
path: /tmp/packages-microsoft-prod.deb