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
import xml.etree.ElementTree as ET | |
def get_hosts(xml_file): | |
''' xml.file -> list | |
For every sin in a given xml_file, return a list containing the FQDN. | |
''' | |
tree = ET.parse(xml_file) | |
root = tree.getroot() | |
sins = [] |
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
print( | |
"The {0} file needs to contain a bare section.".format( | |
sys.argv[1])) | |
exit() |
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
vars: | |
keys_added: | |
- app: "app-ce-async-bridge" | |
key: "ce-jms-cluster.jms.url.list" | |
value: "" | |
- app: "csr" | |
key: "eshopworld-csp.url" | |
value: "{{ eshopworld_csp_url }}" | |
- app: "atg-global-envconfig" | |
key: "ap.esw.cic.http.url" |
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
class Excel_Data(): | |
def __init__(self, path): | |
self.name = path | |
self.book = xlrd.open_workbook(self.name) | |
self.sheet_names = self.book.sheet_names() | |
self.first_sheet = self.book.sheet_by_index(0) | |
self.xls_type = self.check_xls_type() | |
if self.xls_type == 'DIAMOND': | |
self.sales = self.build_diamond(self.first_sheet, self.xls_type) |
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' |
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: 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
# 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: 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
"{{ vms_list | json_query('data.entities[?metadata.categories.Project==`JVTEST2`].status.{name: name}') }}" |
OlderNewer