This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for store_env in store_list %} | |
{% if store_env == 'DEV' %} | |
system_count: | |
server: 1 | |
workstation: 1 | |
register: 1 | |
{% endif %} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = [{'column': 'STORE_NO', 'value': 9001}, {'column': 'STORE_NAME', 'value': 'RE_Thrashing'}] | |
for item in data: | |
columns.append(item['column']) | |
values.append(item['value']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[server:vars] | |
ansible_port=5986 | |
ansible_connection=winrm | |
ansible_winrm_server_cert_validation=ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
gather_facts: True | |
tasks: | |
- name: test | |
debug: var="{{ hostvars[item] }}" | |
with_items: | |
"{{ groups['server'] }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"{{ vms_list | json_query('data.entities[?metadata.categories.Project==`JVTEST2`].status.{name: name}') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
tasks: | |
- set_fact: | |
store: "{{ ansible_env.store }}" | |
source_path: "D:\\LOCALIZATION\\Export\\{{ ansible_env.store }}" | |
destination_file: "D:\\LOCALIZATION\\{{ ansible_env.store }}.zip" | |
- mssql_query: | |
server: sql01 | |
database: STOREINFO_TOOL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Playbook Task | |
- name: 'Find the sterling hosts' | |
sterling_agent_ctrl: | |
env: "{{ target_env }}" | |
AD_PASSWORD: "{{ AD_PASSWORD }}" | |
AD_USER: "{{ AD_USER }}" | |
agent: '{{ agent|default(None) }}' | |
register: sterling_h | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: Control | |
gather_facts: no | |
vars_files: | |
- ../../vault/{{ tower_user_name|default(lookup('env','USER')) }}.yml | |
tasks: | |
- name: Find the sterling hosts | |
sterling_agent_ctrl: | |
env: "{{ target_env }}" | |
AD_PASSWORD: "{{ AD_PASSWORD }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Sterling GET Status | |
shell: "sudo -u app /cust/app/sterling-agent/bin/agentctrl -a status-all | grep pid | wc -l" | |
async: 200 | |
poll: 5 | |
register: sterling_check | |
changed_when: | |
when: action_type == 'stop-all' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: sterling_hosts | |
gather_facts: no | |
tasks: | |
- name: Sterling Agent Control COMMAND | |
command: "disown -a && sudo -u app /cust/app/sterling-agent/bin/agentctrl -a {{ action_type }}" | |
register: sterling_control | |
when: action_type == 'start-all' or action_type == 'status-all' or action_type == 'stop-all' |
NewerOlder