• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to install an application on Windows by using Ansible playbook

  • 01:20 Set-ExecutionPolicy Bypass -Scope Process -Force;
  • 02:03 apt list -a ansible
  • 02:18 apt list -a python3-pip
  • 02:55 ansible-galaxy collection install chocolatey.chocolatey
  • 03:42 vi /etc/ansible/hosts
  • 06:10 ansible-playbook install.yml --syntax-check
  • 06:31 ansible-playbook install.yml
  • 07:28 vi uninstall.yml
  • 09:08 ansible-playbook uninstall.yml --syntax-check
  • 09:28 ansible-playbook uninstall.yml
6737

To Install an Application on Windows by using Ansible playbook

Introduction:

Ansible is an open-source tool for managing software configurations and deploying applications. Chocolately is a management tool for Windows software.

Master Server Requirements:

ansible

python3-pip

pywinrm (python package

Windows Requirements:

powershell 3+

Dot net 4

Installation Procedure:

Step 1: Search for chocolatey in browser Snap 1

Step 2: Copy the installation command in chocolatey install page Snap 2 Step 3: Run Powershell ISE as an administrator Snap 3

Step 4: Install chocolatey by using the following command

PS C:\WINDOWS\system32> Set-ExecutionPolicy Bypass -Scope Process -Force; 

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
Getting latest version of the Chocolatey package for download.
Not using proxy.
Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/0.11.3.
Downloading https://community.chocolatey.org/api/v2/package/chocolatey/0.11.3 to C:\Users\Admin\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
Not using proxy.
Extracting C:\Users\Admin\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\Admin\AppData\Local\Temp\chocolatey\chocoInstall
Installing Chocolatey on the local machine
Creating ChocolateyInstall as an environment variable (targeting 'Machine') 
  Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
WARNING: It's very likely you will need to close and reopen your shell 
  before you can use choco.
Restricting write permissions to Administrators
We are setting up the Chocolatey package repository.
The packages themselves go to 'C:\ProgramData\chocolatey\lib'
  (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
  and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.

Step 5: Check the OS version by using the following command

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

Step 6: Check the availability of Ansible package

root@linuxhelp:~# apt list -a ansible
Listing... Done
ansible/hirsute,hirsute,now 4.8.0-1ppa~hirsute all [installed]
ansible/hirsute,hirsute 2.10.7-1 all

Step 7: Check the availability of python3-pip package

root@linuxhelp:~# apt list -a python3
Listing... Done
python3/hirsute,now 3.9.4-1 amd64 [installed,automatic]

python3/hirsute 3.9.4-1 i386

Step 8: Check the availability of python package pywinrm

root@linuxhelp:~# pip list | grep pywinrm
pywinrm                0.4.2


ansible_winrm_server_cert_validation=ignore

Step 9: Install the plugins of chocolatey for ansible

root@linuxhelp:~# ansible-galaxy collection install chocolatey.chocolatey

Starting galaxy collection install process
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.

Step 10:Create inventory for Windows node system

root@linuxhelp:~# vi /etc/ansible/hosts 

[windows]
192.168.2.134

[windows:vars]
ansible_user=Admin
ansible_password=Admin@123
ansible_port=5986
ansible_connection=winrm

Step 11:Create playbook for installing namecoin application

root@linuxhelp:~# vi install.yml
hosts: windows
  gather_facts: true
  tasks:
  - name: install namecoin
    win_chocolatey:
      name: namecoin
      state: present

Step 12: Check the syntax of the install.yml ansible playbook by using the following command

root@linuxhelp:~# ansible-playbook install.yml --syntax-check

playbook: proxyset.yml

Step 13: Run the install.yml playbook by using the following command

root@linuxhelp:~# ansible-playbook install.yml 

PLAY [windows] **************************************************************************************

TASK [Gathering Facts] ******************************************************************************
ok: [192.168.2.134]

TASK [install namecoin] *****************************************************************************
changed: [192.168.2.134]

PLAY RECAP ******************************************************************************************
192.168.2.134              : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

Step 14 : Namecoin application installed on Windows Client system Snap 4

Step 15: Create playbook for uninstall namecoin application

root@linuxhelp:~# vi uninstall.yml
- hosts: windows
  gather_facts: true
  tasks:
  - name: Uninstall namecoin
    win_chocolatey:
      name: namecoin
      state: absent
~

Step 16: Check the syntax of the uninstall.yml ansible playbook by using the following command

root@linuxhelp:~# ansible-playbook uninstall.yml --syntax-check

playbook: removeproxy.yml

Step 17: Run the uninstall.yml playbook by using the following command

root@linuxhelp:~# ansible-playbook uninstall.yml 

PLAY [windows] **************************************************************************************

TASK [Gathering Facts] ******************************************************************************
ok: [192.168.2.134]

TASK [Uninstall namecoin] ***************************************************************************
changed: [192.168.2.134]

PLAY RECAP ******************************************************************************************
192.168.2.134              : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Step 18: Namecoin application Uninstalled on Windows Client system Snap 5

With this installation of an application on Windows by using Ansible comes to an end

Tags:
elijah
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is Chocolatey used for?

A

Chocolatey is a software management solution that gives you the freedom to create a simple software package

Q

What is the Repository of Chocolatey?

A

The Repository of Chocolatey is github.com/chocolatey/choco

Q

What is the Ansible plugin need to use chocolatey?

A

To use chocolatey in a playbook, need chocolatey.chocolatey.win_chocolatey plgin.

Q

How to list the local package of Chocolatey?

A

Use choco list local to a local package of Chocolatey.

Q

What does Ansible Chocolatey?

A

Chocolatey enables organizations to simplify Windows software management.

Related Tutorials in How to install an application on Windows by using Ansible playbook

Related Tutorials in How to install an application on Windows by using Ansible playbook

How to install Windows 10 VM on Proxmox VE
How to install Windows 10 VM on Proxmox VE
Feb 24, 2018
How to Create Ansible Playbook to Install Apache Server
How to Create Ansible Playbook to Install Apache Server
May 12, 2021
How to Install Mailcatcher in Windows 10
How to Install Mailcatcher in Windows 10
Aug 10, 2019
How to Take Backup and Restore in Issabel
How to Take Backup and Restore in Issabel
Feb 4, 2019
How to set permissions to the files by using Ansible playbook
How to set permissions to the files by using Ansible playbook
Nov 12, 2021
How to install and configure Ansible on OpenSUSE leap 15.0
How to install and configure Ansible on OpenSUSE leap 15.0
Nov 22, 2018
How to install an application on Windows by using Ansible playbook
How to install an application on Windows by using Ansible playbook
Nov 10, 2021
How to install NAXSI Web Application Firewall on Centos7
How to install NAXSI Web Application Firewall on Centos7
Jan 7, 2019

Related Forums in How to install an application on Windows by using Ansible playbook

Related Forums in How to install an application on Windows by using Ansible playbook

Net-SNMP
ryder class=
The SNMP Service encountered an error while accessing the registry key SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration.
Dec 9, 2019
Proxmox
xavier class=
Dual Boot : Windows 7 and Proxmox
Jan 23, 2018
Wifi
matthew class=
The settings saved on this computer for the network do not match the requirements of the network
Dec 30, 2019
Ansible
michael class=
How to Fix “Shared connection to x.x.xx closed” Ansible Error
Nov 6, 2021
Windows
grayson class=
Menu Bar options Are missing In Visual Studio Code.
Aug 23, 2019
Windows
otwol class=
What is the difference Between the net user,net use and net view Commands in Windows CMD
Aug 3, 2019
Windows
Aditya class=
Net Use Command Usage
Jul 31, 2019
ImageMagick
gibbons class=
Windows : ImageMagick (6.8.1) on Laragon
Apr 6, 2018

Related News in How to install an application on Windows by using Ansible playbook

Related News in How to install an application on Windows by using Ansible playbook

Windows 10 lets Linux run inside Windows after Fall Creators Update
Windows 10 lets Linux run inside Windows after Fall Creators Update
Aug 3, 2017
Non- Windows users frustrated with the performance of OneDrive
Non- Windows users frustrated with the performance of OneDrive
Mar 24, 2017
Google expert fuzzes ports Windows Defender to Linux
Google expert fuzzes ports Windows Defender to Linux
May 26, 2017
Linux is too powerful for Windows 10 S, so Microsoft just blocked it
Linux is too powerful for Windows 10 S, so Microsoft just blocked it
May 20, 2017
A Window inside the Linux Desktop
A Window inside the Linux Desktop
Apr 22, 2017
MicroSoft’s App Store Welcomes Linux to their Subsystem
MicroSoft’s App Store Welcomes Linux to their Subsystem
May 13, 2017
Windows to pull the plug on Vista
Windows to pull the plug on Vista
Mar 18, 2017
Microsoft launches Windows 10 beta for business users
Microsoft launches Windows 10 beta for business users
Apr 8, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help David Lopez Guillen ?
Ayuda urgente instale SSL para servidor Opensuse y ahora no funciona tengo servicio web

hola segui este tutorial para tener un certificado ssl y ahora no se ve mi app en la red, espero alguien pueda ayudarme, tengo M9oodle en3.5 en un servidor open suse y ahora no funciona por favor ayuda.

https://www.linuxhelp.com/how-to-create-ssl-certificate-in-opensuse

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.