add win_onec role
This commit is contained in:
39
roles/win_onec/README.md
Normal file
39
roles/win_onec/README.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
win_onec
|
||||||
|
=========
|
||||||
|
|
||||||
|
Install onec on windows machines
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
|
Role Variables
|
||||||
|
--------------
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
ansible.windows
|
||||||
|
|
||||||
|
Example Playbook
|
||||||
|
----------------
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
roles:
|
||||||
|
- role: genlab.common.win_onec
|
||||||
|
win_onec_archive_src: files/windows64full_8_3_26_1540.rar
|
||||||
|
win_onec_version: 8.3.26.1540
|
||||||
|
```
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
BSD
|
||||||
|
|
||||||
|
Author Information
|
||||||
|
------------------
|
||||||
|
|
||||||
|
malyuk.ss@genlab.llc
|
||||||
1
roles/win_onec/defaults/main.yml
Normal file
1
roles/win_onec/defaults/main.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
---
|
||||||
1
roles/win_onec/handlers/main.yml
Normal file
1
roles/win_onec/handlers/main.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
---
|
||||||
16
roles/win_onec/meta/main.yml
Normal file
16
roles/win_onec/meta/main.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
role_name: "win_onec"
|
||||||
|
namespace: genlab
|
||||||
|
author: "Sergey Malyuk"
|
||||||
|
company: "Genlab, LLC"
|
||||||
|
description: "Installs 1C"
|
||||||
|
license: "MIT"
|
||||||
|
min_ansible_version: "2.16"
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
- name: "Windows"
|
||||||
|
|
||||||
|
galaxy_tags: []
|
||||||
|
|
||||||
|
dependencies: []
|
||||||
9
roles/win_onec/molecule/default/converge.yml
Normal file
9
roles/win_onec/molecule/default/converge.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Converge
|
||||||
|
hosts: all
|
||||||
|
pre_tasks:
|
||||||
|
# Blank task for ignoring CI testing
|
||||||
|
# This role was tested manually
|
||||||
|
- name: Blank
|
||||||
|
ansible.builtin.command: echo
|
||||||
|
changed_when: false
|
||||||
22
roles/win_onec/molecule/default/molecule.yml
Normal file
22
roles/win_onec/molecule/default/molecule.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
dependency:
|
||||||
|
name: galaxy
|
||||||
|
driver:
|
||||||
|
name: docker
|
||||||
|
platforms:
|
||||||
|
- name: ubuntu
|
||||||
|
image: geerlingguy/docker-ubuntu2204-ansible:latest
|
||||||
|
pre_build_image: true
|
||||||
|
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||||
|
volumes:
|
||||||
|
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||||
|
cgroupns_mode: host
|
||||||
|
privileged: true
|
||||||
|
provisioner:
|
||||||
|
name: ansible
|
||||||
|
verifier:
|
||||||
|
name: ansible
|
||||||
|
lint: |
|
||||||
|
set -e
|
||||||
|
yamllint .
|
||||||
|
ansible-lint .
|
||||||
11
roles/win_onec/molecule/default/verify.yml
Normal file
11
roles/win_onec/molecule/default/verify.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Verify
|
||||||
|
hosts: all
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
# Blank task for ignoring CI testing
|
||||||
|
# This role was tested manually
|
||||||
|
- name: Blank
|
||||||
|
ansible.builtin.command: echo
|
||||||
|
changed_when: false
|
||||||
54
roles/win_onec/tasks/main.yml
Normal file
54
roles/win_onec/tasks/main.yml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
- name: Check 1C installation
|
||||||
|
block:
|
||||||
|
- name: Get 1C stats
|
||||||
|
register: win_onec_dir
|
||||||
|
ansible.windows.win_stat:
|
||||||
|
path: 'C:\Program Files 64\1cv8\{{ win_onec_version }}'
|
||||||
|
|
||||||
|
- name: Assert that 1C directory exists
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that: win_onec_dir.stat.exists
|
||||||
|
success_msg: "1C {{ win_onec_version }} is installed"
|
||||||
|
fail_msg: "1C {{ win_onec_version }} IS NOT installed"
|
||||||
|
rescue:
|
||||||
|
- name: Create temp directory
|
||||||
|
ansible.windows.win_file:
|
||||||
|
path: C:\tmp
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Push 1C archive
|
||||||
|
ansible.windows.win_copy:
|
||||||
|
src: "{{ win_onec_archive_src }}"
|
||||||
|
dest: C:\tmp\onec_install.rar
|
||||||
|
|
||||||
|
- name: Get 1c installation stats
|
||||||
|
register: win_onec_installation_dir
|
||||||
|
ansible.windows.win_stat:
|
||||||
|
path: C:\tmp\onec_install\
|
||||||
|
|
||||||
|
- name: Extract 1C archive
|
||||||
|
when: not win_onec_installation_dir.stat.exists
|
||||||
|
ansible.windows.win_shell: |
|
||||||
|
7z x "C:\tmp\onec_install.rar" -o"C:\tmp\onec_install" -y
|
||||||
|
|
||||||
|
- name: Install 1C
|
||||||
|
ansible.windows.win_shell: |
|
||||||
|
C:\tmp\onec_install\setup.exe /S /a /l "ru" /debuglog "C:\tmp\onec_install\setup.log"
|
||||||
|
|
||||||
|
- name: Find source files
|
||||||
|
ansible.windows.win_find:
|
||||||
|
paths: C:\tmp\onec_install
|
||||||
|
file_type: file
|
||||||
|
register: win_onec_found_files
|
||||||
|
|
||||||
|
- name: Clean up on C:\ after 1C installation
|
||||||
|
loop: "{{ win_onec_found_files.files }}"
|
||||||
|
ansible.windows.win_file:
|
||||||
|
path: "C:\\{{ item.filename }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Delete tmp directory
|
||||||
|
ansible.windows.win_file:
|
||||||
|
path: C:\tmp
|
||||||
|
state: absent
|
||||||
1
roles/win_onec/vars/main.yml
Normal file
1
roles/win_onec/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
---
|
||||||
Reference in New Issue
Block a user