proxy-stopping.yaml

Overview

This file defines an Ansible playbook designed to deploy a proxy service with the explicit intention to stop it. It targets a group of proxy hosts, optionally specified by an inventory pattern or variable, and applies configuration changes by invoking a predefined role called proxy. The playbook disables the proxy service by setting specific variables that indicate the proxy is not up and should be stopped.


Playbook Structure and Functionality

The playbook consists of a single play with the following components:


Variables in Context


Interaction with Other Components


Usage Example

To stop proxy services on hosts proxy5 to proxy14, you could run:

ansible-playbook proxy-stopping.yaml -e "proxy_target=proxy[5:14]"

If you want to stop the proxy on all hosts grouped under proxy, simply run:

ansible-playbook proxy-stopping.yaml

Implementation Details


Mermaid Diagram

flowchart TD
A[proxy-stopping.yaml Playbook]
A --> B[Set Variables: PROXY_UP=no, PROXY_STOP=yes]
A --> C["Target Hosts: {{ proxy_target | default('proxy') }}"]
A --> D[Invoke Role: proxy]
D --> E[Role interprets variables]
E --> F[Stops Proxy Service on Hosts]

This flowchart illustrates the main workflow of the playbook: setting variables, selecting target hosts, invoking the proxy role, and stopping the proxy service accordingly.