Giter VIP home page Giter VIP logo

ansible-winnginx's Introduction

Ansible test project to install NGINX on Windows

Prerequisites

  • Ansible Control node
  • Windows-machine accessbile from Ansible Control node by WinRM

Run

$ cd ansible-webserver-setup
$ ansible-playbook -i hosts.ini --ask-vault-pass ./playbooks/generate_certs.yml
$ ansible-playbook -i hosts.ini --ask-vault-pass ./playbooks/install_nginx.yml
$ ansible-playbook -i hosts.ini --ask-vault-pass ./playbooks/configure_nginx.yml
$ ansible-playbook -i hosts.ini --ask-vault-pass ./playbooks/setup_firewall.yml
to test
$ ansible-playbook -i hosts.ini --ask-vault-pass ./playbooks/nginx_check.yml

Full Task Description

Test Assignment: Setting Up a Web Server on Windows Using Ansible
Goal:
Configure an Nginx web server on a Windows host using Ansible, including generating self-signed certificates, installing the necessary certificates on the system, configuring Nginx to work over HTTPS, and ensuring secrets management using Ansible Vault.
Steps:

  1. Generate Self-Signed Certificates:
    ◦ Generate a root self-signed certificate (CA certificate).
    ◦ Generate a server certificate signed by the root certificate.
    ◦ Install the root certificate in the "Trusted Root Certification Authorities" of the local machine on the Windows host.
  2. Install and Configure Nginx as a Service:
    ◦ Install Nginx on the Windows host using WinSW (Windows Service Wrapper) to manage Nginx as a service.
    ◦ Add necessary firewall permissions for Nginx to allow incoming connections on HTTP and HTTPS ports. \
  3. Configure Nginx to Work Over HTTPS:
    ◦ Configure Nginx to use the previously created certificates to ensure the web server works over HTTPS. \
  4. Secrets Management:
    ◦ Use Ansible Vault to securely store and manage sensitive data such as passwords and private keys.
    Expected Result:
    After completing all steps, Nginx should be installed and running as a service on the Windows host, configured to work over HTTPS using self-signed certificates. Secrets should be securely managed using Ansible Vault.
    Additional Requirements:
    • Store the results in a GitHub repository.
    • Include a README file with all prerequisites and a link to the repository.
    This task ensures a secure and automated setup of a web server with proper management of sensitive information.

Troubleshooting

  • Check if WinRM works
    winrm get winrm/config/Service
  • Check if WinRM + hosts.ini are correct
    ansible -i hosts.ini -m win_ping DESKTOP-P8D82BI -u Administrator --ask-pass
  • Remove nginx service
    PS Stop-Service -Name nginx PS sc.exe delete nginx

ansible-winnginx's People

Contributors

j-avdeev avatar

Watchers

Lucian avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.