Izveden refactor iz taskov v role

This commit is contained in:
Polz 2023-09-11 22:30:48 +02:00
parent 747438dedf
commit a35460a57b
317 changed files with 2761 additions and 50 deletions

View file

@ -0,0 +1,4 @@
- import_tasks: main_win.yml
when: ansible_connection == 'winrm'
- import_tasks: main_lin.yml
when: ansible_connection == 'ssh'

View file

@ -0,0 +1,24 @@
- name: Install OMNet++
block:
- name: Create destination for Omnet++
file:
path: /opt/omnetpp
state: directory
- name: Download and unpack Omnet++
unarchive:
src: https://github.com/omnetpp/omnetpp/releases/download/omnetpp-6.0.1/omnetpp-6.0.1-linux-x86_64.tgz
dest: /opt/omnetpp
remote_src: yes
# TODO install inet system-wide
- name: Install INET Framework
block:
- name: Create destination for INET Framework
file:
path: /opt/omnetpp-inet
state: directory
- name: Download and unpack INET Framework
unarchive:
src: https://github.com/inet-framework/inet/releases/download/v4.4.1/inet-4.4.1-src.tgz
dest: /opt/omnetpp-inet
remote_src: yes

View file

@ -0,0 +1,47 @@
- name: Set OMNet++ version
set_fact:
target_version: "6.0.1"
target_dir: "C:\\OMNeT++"
- name: Check OMNet++ install status
win_stat:
path: "{{ target_dir }}"
register: file
- when: not file.stat.exists
block:
- name: Download OMNet++
win_get_url:
url: "https://github.com/omnetpp/omnetpp/releases/download/omnetpp-{{ target_version }}/omnetpp-{{ target_version }}-windows-x86_64.zip"
dest: C:\
register: download
- name: Unzip OMNet++
win_unzip:
src: "{{ download.dest }}"
dest: C:\
delete_archive: yes
- name: Move OMNet++ to final location
win_command: cmd.exe /c move "C:\\omnetpp-{{ target_version }}" "{{ target_dir }}"
- name: Create OMNet++ compile script
win_copy:
src: "{{ target_dir }}\\mingwenv.cmd"
dest: "{{ target_dir }}\\mingwenv-install.cmd"
remote_src: yes
- name: Fix OMNet++ compile script
win_lineinfile:
path: "{{ target_dir }}\\mingwenv-install.cmd"
insertbefore: "rem Open the MinGW"
line: call "%HOME%\\tools\\win32.x86_64\\msys2_shell.cmd" -mingw64 -c "./configure && make -j4" & exit
- name: Compile OMNet++
win_command: cmd.exe /c "{{ target_dir }}\\mingwenv-install.cmd"
- name: Copy OMNet++ shortcut
win_copy:
src: "{{ target_dir }}\\OMNeT++ {{ target_version }} IDE.lnk"
dest: "C:\\Users\\Public\\Desktop"
remote_src: yes