Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • icshwi/ics-ans-role-phoebus
  • ics-ansible-galaxy/ics-ans-role-phoebus
2 results
Show changes
Commits on Source (138)
exclude_paths:
- molecule/default/create.yml
skip_list:
- '602'
- '204'
- '208'
- '106'
[flake8]
ignore = E501
ignore = E501,W503,E203,E402
---
extends: default
rules:
......
......@@ -7,11 +7,62 @@ Ansible role to install phoebus.
```yaml
---
phoebus_installation_dir: /opt
phoebus_installations_keep: 2
phoebus_version: 4.6.0-SNAPSHOT
phoebus_archive: "http://artifactory.esss.lu.se/artifactory/libs-snapshot-local/se/europeanspallationsource/ics/ess-phoebus/{{ phoebus_version }}/ess-phoebus-{{ phoebus_version }}-bin.tar.gz"
phoebus_version: 4.6.3
phoebus_repository: "{{ (phoebus_version[-9:] == '-SNAPSHOT') | ternary('libs-snapshot', 'libs-release') }}"
phoebus_archive: "http://artifactory.esss.lu.se/artifactory/{{ phoebus_repository }}/se/europeanspallationsource/ics/ess-cs-studio-phoebus/{{ phoebus_version }}/ess-cs-studio-phoebus-{{ phoebus_version }}-linux.tar.gz"
phoebus_settings_path: "{{ phoebus_home }}/phoebus.ini"
phoebus_logback_config: "{{ phoebus_home }}/logback.xml"
phoebus_settings: {}
phoebus_options: "-logging {{ phoebus_home }}/logging.properties"
phoebus_ess_templates_version: 1.0.4
phoebus_ess_symbols_version: 1.0.5
phoebus_ess_opis_version: master
phoebus_opis_repos: []
phoebus_git_folders_base: /usr/local/share/cs-studio
phoebus_opis_path: "{{ phoebus_git_folders_base }}/opis"
phoebus_ess_symbols_path: "{{ phoebus_git_folders_base }}/ess-symbols"
phoebus_ess_templates_path: "{{ phoebus_git_folders_base }}/ess-templates"
# Set to [] to not create a python environment
phoebus_python_packages:
- python=3.7
- py4j
- connect2j
- numpy=1.17
- scipy=1.3
- pandas=0.25
```
The `-server 4918` option can be added by overriding the `phoebus_options` variable.
The `phoebus_opis_repos` variable is a list of dictionaries with the following keys:
- url: URL to the git repository (mandatory)
- version: version of the repo [default: HEAD]
- dest: directory name where to clone the repo [default: name of the git repo]
Note that `dest` is the relative path under `phoebus_opis_path`.
The following variables:
```yaml
phoebus_opis_path: /data/opis-pbi
phoebus_opis_repos:
- url: https://gitlab.esss.lu.se/beam-diagnostics/opis-pbi/opis-pbi-engineer.git
dest: "10-Engineer/10-ACC/99-PBI"
- url: https://gitlab.esss.lu.se/beam-diagnostics/opis-pbi/opis-pbi-operator.git
dest: "30-Operator/10-ACC/99-PBI"
```
Would create:
```bash
/data/
`-- opis-pbi
|-- 10-Engineer
| `-- 10-ACC
| `-- 99-PBI
`-- 30-Operator
`-- 10-ACC
`-- 99-PBI
```
## Example Playbook
......
---
phoebus_installation_dir: /opt
phoebus_installations_keep: 2
phoebus_version: 4.6.0-SNAPSHOT
phoebus_archive: "http://artifactory.esss.lu.se/artifactory/libs-snapshot-local/se/europeanspallationsource/ics/ess-phoebus/{{ phoebus_version }}/ess-phoebus-{{ phoebus_version }}-bin.tar.gz"
phoebus_settings_path: "{{ phoebus_home }}/phoebus.ini"
phoebus_settings: {}
phoebus_options: "-server 4918"
phoebus_ess_templates_version: 1.0.4
phoebus_ess_symbols_version: 1.0.5
phoebus_ess_opis_version: master
phoebus_opis_repos: []
phoebus_opi_navigators_repos: []
phoebus_git_folders_base: /usr/local/share/cs-studio
phoebus_opis_path: "{{ phoebus_git_folders_base }}/opis"
phoebus_opi_navigators_path: "{{ phoebus_git_folders_base }}/opi-navigators"
phoebus_ess_symbols_path: "{{ phoebus_git_folders_base }}/ess-symbols"
phoebus_ess_templates_path: "{{ phoebus_git_folders_base }}/ess-templates"
phoebus_layouts_path: "{{ phoebus_git_folders_base }}/layouts"
phoebus_layouts_repo: "https://gitlab.esss.lu.se/accop/shared-cs-studio-phoebus-layouts.git"
phoebus_layouts_version: master
# Set to [] to not create a python environment
phoebus_python_packages:
- epics-base=7.0.3.1=h68659b9_4
- python=3.7
- py4j
- pvapy
- connect2j
- numpy=1.17
- scipy=1.3
- pandas=0.25
phoebus_use_system_proxies: true
phoebus_http_proxy_host: ""
phoebus_http_proxy_port: ""
phoebus_http_non_proxy_hosts: []
phoebus_https_proxy_host: ""
phoebus_https_proxy_port: ""
phoebus_javax_net_ssl_trustStore: "{{ '/etc/pki/java/cacerts' if ansible_distribution == 'CentOS' else '/etc/ssl/certs/java/cacerts' }}"
phoebus_maxvram: ""
phoebus_installations:
current:
label: current
version: 5.0.030
old:
label: old
version: 5.0.026
phoebus_jdk_internal_httpclient_debug: false
[Desktop Entry]
Type=Application
Terminal=false
Name=Phoebus
Categories=ESS
Exec=/usr/local/bin/phoebus
# Molecule managed
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
---
dependency:
name: galaxy
lint:
name: yamllint
lint: |
set -e
yamllint .
ANSIBLE_ROLES_PATH=${MOLECULE_EPHEMERAL_DIRECTORY}/roles ansible-lint
flake8
provisioner:
name: ansible
config_options:
defaults:
gather_timeout: 20
lint:
name: ansible-lint
inventory:
group_vars:
molecule_group:
phoebus_opis_path: /data/opis-pbi
phoebus_opis_repos:
- url: https://gitlab.esss.lu.se/beam-diagnostics/opis-pbi/opis-pbi-systemexpert.git
version: "1d34327ea88a12fec5e64c38839e038361e0a660"
- url: https://gitlab.esss.lu.se/beam-diagnostics/opis-pbi/opis-pbi-engineer.git
dest: "10-Engineer/10-ACC/99-PBI"
- url: https://gitlab.esss.lu.se/beam-diagnostics/opis-pbi/opis-pbi-operator.git
dest: "30-Operator/10-ACC/99-PBI"
- url: https://gitlab.esss.lu.se/opis/acc/wtrc/operator.git
dest: 30-Operator/10-ACC/999-WtrC
- url: https://gitlab.esss.lu.se/opis/acc/cryo/systemexpert.git
dest: 20-SystemExpert/10-ACC/999-Cryo/
phoebus_opi_navigators_repos:
- url: https://gitlab.esss.lu.se/opi-navigators/mcr-operations/main.git
dest: mcr-operations/main
phoebus_settings:
org.phoebus.pv.ca/addr_list: 127.0.0.1
phoebus_http_proxy_host: proxy1.example.com
phoebus_http_proxy_port: 8888
phoebus_http_non_proxy_hosts:
- non-proxy.example.com
- non-proxy2.example.com
phoebus_https_proxy_host: proxy2.example.com
phoebus_https_proxy_port: 8889
host_vars:
ics-ans-role-phoebus-onerepo:
phoebus_opis_single_repo: https://gitlab.esss.lu.se/beam-diagnostics/opis-pbi/opis-pbi-engineer.git
phoebus_installations:
current:
label: current
version: 5.0.030
test:
label: test
version: 5.0.036
ics-ans-role-phoebus-ubuntu:
phoebus_installations:
current:
label: current
version: 5.0.030
old:
label: old
version: 5.0.026
test:
label: test
version: 5.0.033
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
driver:
name: docker
platforms:
- name: ics-ans-role-phoebus-default
image: centos:7
image: registry.esss.lu.se/ics-docker/centos-ics:1.0.0
groups:
- molecule_group
- name: ics-ans-role-phoebus-ubuntu
image: ubuntu:22.04
groups:
- molecule_group
- name: ics-ans-role-phoebus-onerepo
image: registry.esss.lu.se/ics-docker/centos-ics:1.0.0
groups:
- molecule_group
---
- name: Prepare
hosts: all
hosts: ics-ans-role-phoebus-default
gather_facts: false
tasks: []
tasks:
- name: install required dependencies
yum:
name:
- tar
- gzip
- git
state: present
- name: install undefined opi repositories # noqa 401
git:
repo: "{{ item.url }}"
dest: "{{ phoebus_opis_path }}/{{ item.dest | default(item.url | basename | replace('.git', '')) }}"
force: true
loop:
- url: https://gitlab.esss.lu.se/opis/acc/ts2/rf/engineer.git
dest: 10-Engineer/10-ACC/999-TS2/99-RF
- url: https://gitlab.esss.lu.se/opis/acc/ts2/rf/systemexpert.git
dest: 20-SystemExpert/10-ACC/999-TS2/99-RF
- url: https://gitlab.esss.lu.se/opis/acc/cryo/systemexpert.git
dest: 20-SystemExpert/10-ACC/999-Cryo/
- url: https://gitlab.esss.lu.se/opis/acc/ops/operator.git
dest: 30-Operator/10-ACC/000-Ops/
......@@ -3,31 +3,74 @@ import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
PHOEBUS_VERSION = '4.6.0-SNAPSHOT'
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_default(host):
cmd = host.run("/opt/ess-phoebus-{}/phoebus.sh -help".format(PHOEBUS_VERSION))
cmd = host.run("/usr/local/bin/phoebus_current -help")
assert cmd.rc == 0
assert " _______ _______ _______ ______ _______ \n" + \
"( ____ )|\\ /|( ___ )( ____ \\( ___ \\ |\\ /|( ____ \\\n" + \
"| ( )|| ) ( || ( ) || ( \\/| ( ) )| ) ( || ( \\/\n" + \
"| (____)|| (___) || | | || (__ | (__/ / | | | || (_____ \n" + \
"| _____)| ___ || | | || __) | __ ( | | | |(_____ )\n" + \
"| ( | ( ) || | | || ( | ( \\ \\ | | | | ) |\n" + \
"| ) | ) ( || (___) || (____/\\| )___) )| (___) |/\\____) |\n" + \
"|/ |/ \\|(_______)(_______/|/ \\___/ (_______)\\_______)" in cmd.stdout
assert (
" _______ _______ _______ ______ _______ \n"
+ "( ____ )|\\ /|( ___ )( ____ \\( ___ \\ |\\ /|( ____ \\\n"
+ "| ( )|| ) ( || ( ) || ( \\/| ( ) )| ) ( || ( \\/\n"
+ "| (____)|| (___) || | | || (__ | (__/ / | | | || (_____ \n"
+ "| _____)| ___ || | | || __) | __ ( | | | |(_____ )\n"
+ "| ( | ( ) || | | || ( | ( \\ \\ | | | | ) |\n"
+ "| ) | ) ( || (___) || (____/\\| )___) )| (___) |/\\____) |\n"
+ "|/ |/ \\|(_______)(_______/|/ \\___/ (_______)\\_______)"
in cmd.stdout
)
def test_settings(host):
settings = host.file("/opt/ess-phoebus-{}/phoebus.ini".format(PHOEBUS_VERSION))
settings = host.file("/opt/ess-cs-studio-phoebus-5.0.030/phoebus.ini")
assert settings.exists
assert settings.is_file
assert settings.contains("org.phoebus.pv.ca/addr_list=127.0.0.1")
def test_java_path(host):
start_script = host.file("/opt/ess-phoebus-{}/phoebus.sh".format(PHOEBUS_VERSION))
assert start_script.contains("/opt/java/jdk")
def test_opis_repositories(host):
if (
host.ansible.get_variables()["inventory_hostname"]
!= "ics-ans-role-phoebus-onerepo"
):
for filename in (
"/usr/local/share/cs-studio/ess-opis/README.md",
"/data/opis-pbi/opis-pbi-systemexpert/README.md",
"/data/opis-pbi/10-Engineer/10-ACC/99-PBI/README.md",
"/data/opis-pbi/30-Operator/10-ACC/99-PBI/README.md",
"/data/opis-pbi/20-SystemExpert/10-ACC/999-Cryo/README.md",
):
assert host.file(filename).exists
cmd = host.run("cd /data/opis-pbi/opis-pbi-systemexpert;git rev-parse HEAD")
assert cmd.stdout.strip() == "1d34327ea88a12fec5e64c38839e038361e0a660"
else:
for filename in (
"/data/opis-pbi/10-Engineer/10-ACC/99-PBI/README.md",
):
assert host.file(filename).exists
cmd = host.run("cd /data/opis-pbi/10-Engineer/10-ACC/99-PBI;git rev-parse HEAD")
assert cmd.stdout.strip() == "fd19d4765d8cee0480f2bfa86efb72e1051fad69"
for filename in (
"/data/opis-pbi/opis-pbi-systemexpert/README.md",
"/data/opis-pbi/30-Operator/10-ACC/99-PBI/README.md",
"/data/opis-pbi/20-SystemExpert/10-ACC/999-Cryo/README.md",
):
assert host.file(filename).exists is False
def test_opis_repositories_are_deleted(host):
for filename in (
"/data/opis-pbi/20-SystemExpert/10-ACC/999-TS2/99-RF/README.md",
"/data/opis-pbi/10-Engineer/10-ACC/999-TS2/99-RF/README.md",
"/data/opis-pbi/30-Operator/10-ACC/000-Ops/README.md",
):
assert host.file(filename).exists is False
def test_opi_navigators(host):
for filename in (
"/usr/local/share/cs-studio/opi-navigators/mcr-operations/main/README.md",
):
assert host.file(filename).exists
---
- name: install required dependencies
yum:
package:
name:
- tar
- gzip
- git
- shared-mime-info
state: present
- name: create installation directory
......@@ -14,22 +16,103 @@
group: root
mode: 0755
- name: create navigators directory
file:
path: /opt/navigators
state: directory
owner: root
group: root
mode: 0755
- name: install Phoebus
unarchive:
src: "{{ phoebus_archive }}"
src: "http://artifactory.esss.lu.se/artifactory/{{ (installation.value.version[-9:] == '-SNAPSHOT') | ternary('libs-snapshot', 'libs-release') }}/se/europeanspallationsource/ics/ess-cs-studio-phoebus/{{ installation.value.version }}/ess-cs-studio-phoebus-{{ installation.value.version }}-linux.tar.gz"
dest: "{{ phoebus_installation_dir }}"
remote_src: true
owner: root
group: root
creates: "{{ phoebus_home }}"
creates: "{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}"
loop: "{{ phoebus_installations | dict2items }}"
loop_control:
loop_var: installation
- name: Download the documentation artifact from Artifactory
unarchive:
src: "http://artifactory.esss.lu.se/artifactory/libs-release-local/org/phoebus/parent/{{ installation.value.version }}/parent-{{ installation.value.version }}.tar.gz"
dest: "{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}"
remote_src: true
owner: root
group: root
creates: "{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/doc" # This will extract only the 'doc' folder
loop: "{{ phoebus_installations | dict2items }}"
loop_control:
loop_var: installation
- name: add Phoebus settings
- name: find bundled aspectjweaver
find:
paths: "{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/lib"
patterns: "^aspectjweaver-(\\d+)(.\\d+)*(-.*)?.jar$"
use_regex: true
register: aspectjweaver_jar
loop: "{{ phoebus_installations | dict2items }}"
loop_control:
loop_var: installation
- name: add Phoebus settings and Kafka client config INI
template:
src: phoebus.ini.j2
dest: "{{ phoebus_settings_path }}"
dest: "{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/phoebus.ini"
owner: root
group: root
mode: 0644
loop: "{{ phoebus_installations | dict2items }}"
loop_control:
loop_var: installation
tags:
- phoebus-ini
- name: add Phoebus settings and Kafka client config LOGBACK
template:
src: logback.xml.j2
dest: "{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/logback.xml"
owner: root
group: root
mode: 0644
loop: "{{ phoebus_installations | dict2items }}"
loop_control:
loop_var: installation
- name: Check if the file exists
stat:
path: /usr/local/bin/phoebus # The path to the file to be checked
register: file_status
- name: Remove existing phoebus symlink or file if it exists
file:
path: /usr/local/bin/phoebus # The path to the symlink or file to be removed
state: absent
when: file_status.stat.exists and not file_status.stat.islnk
- name: Check if the file exists
stat:
path: /opt/phoebus # The path to the file to be checked
register: file_status
- name: Remove existing phoebus symlink or file if it exists
file:
path: /opt/phoebus # The path to the symlink or file to be removed
state: absent
when: file_status.stat.exists and file_status.stat.islnk
- name: Create a phoebus symbolic link of current version
file:
src: /usr/local/bin/phoebus_current # The target file or directory
dest: /usr/local/bin/phoebus # The path where the symlink will be created
state: link
follow: false
force: yes
owner: root
group: root
- name: add MIME types
copy:
......@@ -43,40 +126,213 @@
- name: create phoebus startup script
template:
src: phoebus.j2
dest: /usr/local/bin/phoebus
dest: /usr/local/bin/phoebus_{{ installation.value.label }}
owner: root
group: root
mode: 0755
loop: "{{ phoebus_installations | dict2items }}"
loop_control:
loop_var: installation
- name: Find all startup scripts
find:
paths: "/usr/local/bin"
pattern: "phoebus_*"
file_type: file
register: phoebus_existing_startup_scripts
- name: Remove obsolete startup scripts
file:
path: "{{ item.path }}"
state: absent
when: (item['path'].split('_') | last) not in (phoebus_installations.values() | map(attribute='label') | list)
loop: "{{ phoebus_existing_startup_scripts.files }}"
- name: Find files matching the pattern
stat:
path: /usr/share/applications/phoebus.desktop # The path to the file to be checked
register: file_status
- name: Remove existing phoebus symlink or file if it exists
file:
path: /usr/share/applications/phoebus.desktop # The path to the symlink or file to be removed
state: absent
when: file_status.stat.exists and not file_status.stat.islnk
- name: add Phoebus to desktop menu
copy:
src: phoebus.desktop
dest: /usr/share/applications/phoebus.desktop
template:
src: phoebus.desktop.j2
dest: /usr/share/applications/phoebus_{{ installation.value.label }}.desktop
owner: root
group: root
mode: 0644
loop: "{{ phoebus_installations | dict2items }}"
loop_control:
loop_var: installation
- name: Find all desktop menu items
find:
paths: /usr/share/applications
pattern: "phoebus_*.desktop"
file_type: file
register: phoebus_existing_desktop_menu
- name: Remove obsolete desktop menu items
file:
path: "{{ item.path }}"
state: absent
when: (item['path'] | regex_replace('^/usr/share/applications/phoebus_(.*).desktop$', '\\1')) not in (phoebus_installations.values() | map(attribute='label') | list)
loop: "{{ phoebus_existing_desktop_menu.files }}"
- name: Remove old phoebus navigator desktop menu
file:
path: /usr/share/applications/phoebus_navigator.desktop
state: absent
- name: Get all installations
find:
paths: "{{ phoebus_installation_dir }}"
pattern: "ess-phoebus-*"
pattern: "ess-cs-studio-phoebus-*"
file_type: directory
register: phoebus_installations
register: phoebus_existing_installations
- name: Remove obsolete installations
file:
path: "{{ item.path }}"
state: absent
loop: "{{ (phoebus_installations.files | sort(attribute='ctime', reverse=True))[phoebus_installations_keep:] }}"
when: (item['path'].split('-') | last) not in (phoebus_installations.values() | map(attribute='version') | list)
loop: "{{ phoebus_existing_installations.files }}"
- name: install Python environment
conda:
name: "{{ phoebus_python_packages }}"
state: present
channels:
- ics-conda
- conda-forge
- anaconda-main
environment: csstudio
- block:
- name: install Python environment
conda:
name: "{{ phoebus_python_packages }}"
state: present
channels:
- ics-conda
- conda-forge
environment: csstudio
rescue:
- name: remove csstudio environment (update failed)
conda_env:
name: csstudio
state: absent
- name: create Python environment
conda:
name: "{{ phoebus_python_packages }}"
state: present
channels:
- ics-conda
- conda-forge
environment: csstudio
when: phoebus_python_packages != []
tags: phoebus-python-env
# Do not use a loop to be able to trigger an individual
# update of the git repository by passing only one version
- name: install CS-Studio ess-templates folder
git:
repo: https://gitlab.esss.lu.se/ics-software/ess-templates.git
dest: "{{ phoebus_ess_templates_path }}"
version: "{{ phoebus_ess_templates_version }}"
tags:
- phoebus-ess-templates
- phoebus-git-folders
- name: install CS-Studio ess-symbols folder
git:
repo: https://gitlab.esss.lu.se/ics-software/ess-symbols.git
dest: "{{ phoebus_ess_symbols_path }}"
version: "{{ phoebus_ess_symbols_version }}"
tags:
- phoebus-ess-symbols
- phoebus-git-folders
- name: install CS-Studio legacy ess-opis folder
git:
repo: https://gitlab.esss.lu.se/ics-software/ess-opis.git
dest: "{{ phoebus_git_folders_base }}/ess-opis"
version: "{{ phoebus_ess_opis_version }}"
tags:
- phoebus-ess-opis
- phoebus-git-folders
- name: install CS-Studio OPIs repositories
git:
repo: "{{ item.url }}"
dest: "{{ phoebus_opis_path }}/{{ item.dest | default(item.url | basename | replace('.git', '')) }}"
version: "{{ item.version | default(omit) }}"
force: true
loop: "{{ phoebus_opis_repos }}"
tags:
- phoebus-ess-opis
- phoebus-git-folders
register: phoebus_git_data
when: (phoebus_opis_single_repo is defined and phoebus_opis_single_repo == item.url) or phoebus_opis_single_repo is not defined
- name: install CS-Studio layouts folder
git:
repo: "{{ phoebus_layouts_repo }}"
dest: "{{ phoebus_layouts_path }}"
version: "{{ phoebus_layouts_version }}"
tags:
- phoebus-layouts
- phoebus-git-folders
- name: Find opi repo folders # Searches the opi path for repos with included gitlab-ci.yml file
find:
paths: "{{ phoebus_opis_path }}"
file_type: directory
hidden: true
recurse: true
patterns:
- '.git'
register: phoebus_opis_found_repos
tags:
- phoebus-ess-opis
when: phoebus_opis_single_repo is not defined
- name: Remove repositories not defined in phoebus_opis_repos # parses through found repos and compare them to defined opi repos.
file:
path: "{{ item.path | dirname }}"
state: absent
when: phoebus_opis_single_repo is not defined and (item.path | dirname not in phoebus_git_data.results | map(attribute='invocation.module_args.dest') | list) and (item.path | dirname + '/' not in phoebus_git_data.results | map(attribute='invocation.module_args.dest') | list)
loop: "{{ phoebus_opis_found_repos.files }}"
tags:
- phoebus-ess-opis
- name: install OPI navigators
git:
repo: "{{ item.url }}"
dest: "{{ phoebus_opi_navigators_path }}/{{ item.dest | default(item.url | basename | replace('.git', '')) }}"
version: "{{ item.version | default(omit) }}"
force: true
loop: "{{ phoebus_opi_navigators_repos }}"
when: (phoebus_opi_navigators_single_repo is defined and phoebus_opi_navigators_single_repo == item.url) or phoebus_opi_navigators_single_repo is not defined
register: phoebus_opi_navigators_gits
tags:
- phoebus-opi-navigators
- name: Find installed OPI navigators
find:
paths: "{{ phoebus_opi_navigators_path }}"
file_type: directory
hidden: true
recurse: true
patterns:
- '.git'
when: phoebus_opi_navigators_single_repo is not defined
register: phoebus_opi_navigators_found_repos
tags:
- phoebus-opi-navigators
- name: Remove installed OPI navigators not defined in phoebus_opi_navigators_repos
file:
path: "{{ item.path | dirname }}"
state: absent
when: phoebus_opi_navigators_single_repo is not defined and (item.path | dirname not in phoebus_opi_navigators_gits.results | map(attribute='invocation.module_args.dest') | list) and (item.path | dirname + '/' not in phoebus_opi_navigators_gits.results | map(attribute='invocation.module_args.dest') | list)
loop: "{{ phoebus_opi_navigators_found_repos.files }}"
tags:
- phoebus-opi-navigators
<configuration>
<root level="off">
</root>
</configuration>
[Desktop Entry]
Type=Application
Terminal=false
Name=CS Studio - {{ installation.value.version }} - {{ installation.value.label }}
Comment=Control System Studio application
Icon={{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/css-512x512.png
Categories=ESS
Exec=/usr/local/bin/phoebus_{{ installation.value.label }}
#!/usr/bin/env bash
PHOEBUS_OPTS="{{ phoebus_options }}"
PHOEBUS_JAR={{ phoebus_home }}/product-{{ phoebus_version }}.jar
PHOEBUS_OPTS="-logging {{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/logging.properties"
PHOEBUS_JAR={{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/ess-cs-studio-phoebus-{{ installation.value.version }}-linux.jar
if [[ -d /opt/conda/envs/csstudio/bin ]]
then
......@@ -9,4 +9,10 @@ then
conda activate csstudio
fi
{{ java_openjdk_bin }} $JAVA_ARGS $JAVA_OPTS -jar $PHOEBUS_JAR $PHOEBUS_OPTS -resource %f -settings "{{ phoebus_settings_path }}"
# ESS_OPIS is specific to the old ess-opis repo
# See https://jira.esss.lu.se/browse/INFRA-2105
export ESS_OPIS="{{ phoebus_git_folders_base }}/ess-opis"
export ESS_SYMBOLS="{{ phoebus_ess_symbols_path }}"
export JAVA_ARGS="-javaagent:{{ (aspectjweaver_jar.results | selectattr('installation.key', 'eq', installation.value.label) | list | first).files[0].path }} -XX:+DisableAttachMechanism -Djavax.net.ssl.trustStore={{ phoebus_javax_net_ssl_trustStore }} -Djava.net.useSystemProxies={{ phoebus_use_system_proxies | string | lower }} $JAVA_ARGS"
{{ java_openjdk_bin }} $JAVA_ARGS $JAVA_OPTS{{ " -Dhttp.proxyHost=" + phoebus_http_proxy_host if phoebus_http_proxy_host else "" }}{{ " -Dhttp.proxyPort=" + (phoebus_http_proxy_port | string) if phoebus_http_proxy_port else "" }}{{ " -Dhttp.nonProxyHosts=" + (phoebus_http_non_proxy_hosts | join('|') | quote ) if phoebus_http_non_proxy_hosts else "" }}{{ " -Dhttps.proxyHost=" + phoebus_https_proxy_host if phoebus_https_proxy_host else "" }}{{ " -Dhttps.proxyPort=" + (phoebus_https_proxy_port | string) if phoebus_https_proxy_port else "" }} -Dlogback.configurationFile="{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/logback.xml"{{ " -Dprism.maxvram=" + (phoebus_maxvram | string) if phoebus_maxvram else "" }} -Djdk.internal.httpclient.debug="{{ phoebus_jdk_internal_httpclient_debug }}" -jar $PHOEBUS_JAR $PHOEBUS_OPTS -app navigator -settings "{{ phoebus_installation_dir }}/ess-cs-studio-phoebus-{{ installation.value.version }}/phoebus.ini" $@
---
phoebus_home: "{{ phoebus_installation_dir }}/ess-phoebus-{{ phoebus_version }}"
conda_channels:
- conda-e3-virtual
- ics-conda-forge
- conda-forge
java_openjdk_version: 17.0.10+7