diff --git a/copy.yml b/copy.yml new file mode 100644 index 0000000..c05edcc --- /dev/null +++ b/copy.yml @@ -0,0 +1,8 @@ +- hosts: windows + remote_user: root + become: yes + tasks: + - name: Copy a single file + ansible.windows.win_copy: + src: C:\jenkins\workspace\project win + dest: C:\jenkins\ \ No newline at end of file diff --git a/ec2.yml b/ec2.yml new file mode 100644 index 0000000..52385ec --- /dev/null +++ b/ec2.yml @@ -0,0 +1,10 @@ +all: + hosts: + windows: + ansible_host: ec2-18-132-47-61.eu-west-2.compute.amazonaws.com + ansible_user: administrator + ansible_password: + ansible_port: 5986 + ansible_connection: winrm + ansible_winrm_scheme: https + ansible_winrm_server_cert_validation: ignore diff --git a/galaxy.yml b/galaxy.yml new file mode 100644 index 0000000..000f1f9 --- /dev/null +++ b/galaxy.yml @@ -0,0 +1,21 @@ +namespace: ansible +name: windows +version: 1.7.2 +readme: README.md +authors: +- Jordan Borean @jborean93 +- Matt Davis @nitzmahone +description: | + Ansible collection for core Windows plugins. +license_file: COPYING +tags: +- windows +dependencies: {} +repository: https://github.com/ansible-collections/ansible.windows +documentation: https://github.com/ansible-collections/ansible.windows/tree/main/docs +homepage: https://github.com/ansible-collections/ansible.windows +issues: https://github.com/ansible-collections/ansible.windows/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc +build_ignore: +- .vscode +- tests/integration/inventory* +- changelogs/.plugin-cache.yaml \ No newline at end of file diff --git a/win_copy_files.yml b/win_copy_files.yml new file mode 100644 index 0000000..683af09 --- /dev/null +++ b/win_copy_files.yml @@ -0,0 +1,25 @@ + +- name: Copy files in windows systems + hosts: windows + gather_facts: false + tasks: + - name: copying existing files to temp + win_copy: + src: C:\jenkins\workspace\project win + dest: C:\Users\Administrator + remote_src: yes + register: C + + - name: copying current file to sql server + win_copy: + src: /var/lib/jenkins/workspace/mano/ + dest: C:\jenkins\workspace\ + remote_dest: True + when: C.win_copy.exists == True + register: S + + - name: Remove directory structure + ansible.windows.win_file: + path: C:\Users\Administrator\project win + state: absent + when: S.win_copy.exists == True diff --git a/win_server.yaml b/win_server.yaml new file mode 100644 index 0000000..a981c6a --- /dev/null +++ b/win_server.yaml @@ -0,0 +1,10 @@ +all: + hosts: + windows: + ansible_host: ec2-54-163-202-107.compute-1.amazonaws.com + ansible_user: administrator + ansible_password: f9CBDc2*B2w2BqjhxeDByN6o$oilepA& + ansible_port: 5986 + ansible_connection: winrm + ansible_winrm_scheme: https + ansible_winrm_server_cert_validation: ignore