Ansible/playbook/linux/install-powershell.yml
James Tombleson 02c5a9c632 Big changes to Elastic services
Install-Client and Install-Server are now valid.  They will install what is needed per the hosts file.  Computers in Linux will get client and computers in Elastic will get server.
2019-04-22 15:01:56 -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