diff --git a/.gitignore b/.gitignore index 3b5294a..ef09235 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ other_stuff/*/*.png # roles & dependencies roles/marvel-nccr* +roles/gantsign* diff --git a/CHANGELOG.md b/CHANGELOG.md index 796fc50..ffbc6d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## Quantum Mobile v19.09.0 + +### Improvements +* first official Quantum Mobile release with AiiDA 1.0 +* python environment switched from 2.7 to 3.6 + +### Software updates +* aiida-core v1.0.0b6 + * aiida-quantumespresso v3.0.0a4 +* aiidalab v19.08.0a1 + +## Quantum Mobile v19.07.0 + +### Improvements +* now installing fixed versions of ansible roles for improved reproducibility + and tracking of changes between Quantum Mobile releases +* now installing codes system-wide for better reuse in servers + + following ansible conventions + +### Software updates +* aiidalab v19.05.3 + +### Build process +* ansible 2.7.10 +* Vagrant v2.2.5 + * vbguest v0.19.0 + * bento/ubuntu-18.04 v201906.18.0 +* Virtualbox v6.0.10 + ## Quantum Mobile v19.03.0 ### Improvements diff --git a/Vagrantfile b/Vagrantfile index 1fa6466..4e8dc01 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -26,6 +26,8 @@ Vagrant.configure(2) do |config| vb.customize ["modifyvm", :id, "--vram", gconfig['vm_vram']] # makes mouse/typing more responsive vb.customize ["modifyvm", :id, "--accelerate3d", "on"] + # see https://github.com/marvel-nccr/quantum-mobile/issues/99 + vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"] vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"] vb.customize ["modifyvm", :id, "--draganddrop", "bidirectional"] # turn off remote display (requires Virtualbox Extension pack) @@ -51,7 +53,7 @@ Vagrant.configure(2) do |config| #config.vm.box = "bento/ubuntu-16.04" #config.vm.box_version = "201803.24.0" config.vm.box = "bento/ubuntu-18.04" - config.vm.box_version = "201812.27.0" + config.vm.box_version = "201906.18.0" #config.vm.box = "ubuntu/xenial64" config.vm.boot_timeout = 60 @@ -74,7 +76,7 @@ Vagrant.configure(2) do |config| ansible.verbose = "v" ansible.playbook = "playbook.yml" ansible.extra_vars = { - ansible_python_interpreter: "/usr/bin/python2.7", + ansible_python_interpreter: "/usr/bin/python3", } ansible.raw_arguments = Shellwords.shellsplit(ENV['ANSIBLE_ARGS']) if ENV['ANSIBLE_ARGS'] end diff --git a/globalconfig.yml b/globalconfig.yml index 6903628..d003529 100644 --- a/globalconfig.yml +++ b/globalconfig.yml @@ -1,7 +1,7 @@ --- # Caution: This file is read by vagrant, ansible and bash -vm_version: "19.03.0" vm_name: "Quantum Mobile" +vm_version: "19.09.0" vm_description: "A Virtual Machine for Computational Materials Science" vm_url: "https://github.com/marvel-nccr/marvel-virtualmachine" vm_author: "MARVEL NCCR and MaX CoE" @@ -20,4 +20,4 @@ vm_codes_folder: "${HOME}/codes" vm_examples_folder: "${HOME}/examples" vm_headless: False vm_browser: chromium-browser # 'chromium-browser' or 'firefox' -vm_scheduler: slurm # 'slurm' or 'torque' +vm_scheduler: slurm # 'slurm' or 'direct' diff --git a/hosts b/hosts index 351d7c0..61ca46b 100644 --- a/hosts +++ b/hosts @@ -1,4 +1,6 @@ [vms:vars] ansible_ssh_common_args= -F vagrant-ssh +# modify this line to switch to python2 +ansible_python_interpreter=/usr/bin/python3 [vms] default ansible_user=vagrant diff --git a/other_stuff/reconnect_vagrant.txt b/other_stuff/reconnect_vagrant.txt index 0a6249a..b0176a3 100644 --- a/other_stuff/reconnect_vagrant.txt +++ b/other_stuff/reconnect_vagrant.txt @@ -1,4 +1,6 @@ -In order to connect vagrant to a new VM in Virtualbox: +In order to connect vagrant to a new VM in Virtualbox, use ./reconnect_vagrant.sh + +### Old instructions 1. Get uuid of machine from: vboxmanage list vms 2. echo "" > .vagrant/machines/default/virtualbox/id @@ -10,7 +12,7 @@ folder which contains, amongst other things, the private key. 3. cp ~/.vagrant.d/insecure_private_key .vagrant/machines/default/virtualbox/ 4. Generate the corresponding public key - ssh-keygen -y -f ~/.vagrant.d/insecure_private_key + ssh-keygen -y -f ~/.vagrant.d/private_key 5. Use the Virtualbox GUI to paste the public key inside the VM: mkdir -p ~/.ssh vim ~/.ssh/authorized_keys diff --git a/playbook.yml b/playbook.yml index bd2bfe2..00c0592 100644 --- a/playbook.yml +++ b/playbook.yml @@ -1,11 +1,5 @@ --- - name: Install ansible prerequisites - hosts: default - gather_facts: no - roles: - - marvel-nccr.ansible_prerequisites - -- name: Add vm user hosts: default gather_facts: no pre_tasks: @@ -20,38 +14,35 @@ debug: msg: Connecting to host '{{ inventory_hostname }}' as user '{{ ansible_user }}' roles: - - name: add user {{ vm_user }} with key - role: marvel-nccr.add_user - vars: - add_user_name: "{{ vm_user }}" - add_user_password: "{{ vm_password }}" - add_user_sudo: True - -# Note: it is important to pass variables to roles using the 'vars' dictionary. + - role: marvel-nccr.ansible_prerequisites + +# Note: Pass variables to roles using the 'vars' dictionary! # If variables are passed on the same indentation level as the role, the variable is # set correctly inside the role, but following roles will read the *default* # value of the variable (as defined inside the role). - name: set up the VM hosts: default - become: True - become_user: "{{ vm_user }}" - pre_tasks: - - name: import global variables - tags: always - include_vars: - file: globalconfig.yml vars: - release_notes: True + - release_notes_vm_user: "{{ vm_user }}" - run_tests: False - clean: False - root_user: root - cloud_platform: virtualbox roles: + - name: add user {{ vm_user }} with key + role: marvel-nccr.add_user + vars: + add_user_name: "{{ vm_user }}" + add_user_password: "{{ vm_password }}" + add_user_groups: + - "{{ vm_user }}" + - sudo + add_user_passwordless_sudo: true - role: marvel-nccr.simulationbase tags: simulationbase vars: simulationbase_vm_user: "{{ vm_user }}" - simulationbase_vm_user_public_key: "{{ lookup('file', './keys/aiida_tutorial_aiidaaccount.pub') }}" simulationbase_hostname: "{{ vm_hostname }}" simulationbase_codes_folder: "{{ vm_codes_folder }}" - role: marvel-nccr.ubuntu_desktop @@ -74,49 +65,40 @@ qm_customizations_examples_folder: "{{ vm_examples_folder }}" - role: marvel-nccr.editors tags: editors + vars: + editors_vm_user: "{{ vm_user }}" - role: marvel-nccr.slurm tags: slurm vars: slurm_hostname: "{{ vm_hostname }}" slurm_cpus: "{{ vm_cpus }}" slurm_memory: "{{ vm_memory }}" -# - role: marvel-nccr.torque -# tags: torque -# vars: -# torque_hostname: "{{ vm_hostname }}" -# torque_cpus: "{{ vm_cpus }}" - role: marvel-nccr.quantum_espresso tags: quantum_espresso - vars: - quantum_espresso_code_folder: "{{ vm_codes_folder }}" - role: marvel-nccr.yambo tags: yambo - vars: - yambo_code_folder: "{{ vm_codes_folder }}" - role: marvel-nccr.fleur tags: fleur - vars: - fleur_code_folder: "{{ vm_codes_folder }}" - role: marvel-nccr.siesta tags: siesta - vars: - siesta_code_folder: "{{ vm_codes_folder }}" - role: marvel-nccr.cp2k tags: cp2k - vars: - cp2k_code_folder: "{{ vm_codes_folder }}" + #vars: + # cp2k_installation_route: "apt" - role: marvel-nccr.wannier90 tags: wannier90 - vars: - wannier90_code_folder: "{{ vm_codes_folder }}" + - role: marvel-nccr.aiidalab + become: true + become_user: "{{ vm_user }}" + tags: aiidalab + vars: + aiidalab_headless: "{{ vm_headless }}" - role: marvel-nccr.aiida tags: aiida + become: true + become_user: "{{ vm_user }}" vars: aiida_code_folder: "{{ vm_codes_folder }}" aiida_localhost_cpus: "{{ vm_cpus }}" aiida_localhost_scheduler: "{{ vm_scheduler }}" aiida_examples_folder: "{{ vm_examples_folder }}" - - role: marvel-nccr.aiidalab - tags: aiidalab - vars: - aiidalab_headless: "{{ vm_headless }}" diff --git a/requirements.yml b/requirements.yml index 0cc3eac..b20a242 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,37 +1,41 @@ --- -# Needed to modify this role for become_user -# See https://github.com/marvel-nccr/quantum-mobile/issues/67 -#- src: gantsign.default-web-browser -# version: 3.1.0 +- src: gantsign.default-web-browser + version: 3.2.0 - src: marvel-nccr.ansible_prerequisites - version: master + version: v0.1.0 - src: marvel-nccr.current_user - version: master + version: v0.1.0 - src: marvel-nccr.add_user - version: master + version: v0.2.1 - src: marvel-nccr.simulationbase - version: master + version: v1.0.0 - src: marvel-nccr.ubuntu_desktop - version: master + version: v1.0.0 - src: marvel-nccr.quantum_mobile_customizations - version: master + version: v1.0.0 - src: marvel-nccr.editors - version: master + version: v1.0.1 - src: marvel-nccr.slurm - version: master + version: v1.0.0 - src: marvel-nccr.quantum_espresso - version: master + version: v1.0.1 - src: marvel-nccr.yambo - version: master + version: v1.0.0 - src: marvel-nccr.fleur - version: master + version: v1.0.0 - src: marvel-nccr.siesta - version: master + version: v1.0.1 - src: marvel-nccr.cp2k - version: master + version: v1.0.1 - src: marvel-nccr.wannier90 - version: master -- src: marvel-nccr.aiida - version: master -- src: marvel-nccr.aiidalab - version: master + version: v1.0.0 +#- src: marvel-nccr.aiida +# version: v0.1.2 +- src: https://github.com/marvel-nccr/ansible-role-aiida.git + version: develop + name: marvel-nccr.aiida +#- src: marvel-nccr.aiidalab +# version: v0.1.2 +- src: https://github.com/marvel-nccr/ansible-role-aiidalab.git + version: develop + name: marvel-nccr.aiidalab diff --git a/roles/gantsign.default-web-browser/.editorconfig b/roles/gantsign.default-web-browser/.editorconfig deleted file mode 100644 index 9f24421..0000000 --- a/roles/gantsign.default-web-browser/.editorconfig +++ /dev/null @@ -1,19 +0,0 @@ -# EditorConfig: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Defaults for all editor files -[*] -insert_final_newline = true -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true - -# Files with a smaller indent -[*.yml] -indent_size = 2 - -# Jinja2 template files -[*.j2] -end_of_line = lf diff --git a/roles/gantsign.default-web-browser/.gitattributes b/roles/gantsign.default-web-browser/.gitattributes deleted file mode 100644 index 9601d38..0000000 --- a/roles/gantsign.default-web-browser/.gitattributes +++ /dev/null @@ -1,43 +0,0 @@ -# Set the default behavior, in case people don't have core.autocrlf set. -* text=auto - -# Explicitly declare text files you want to always be normalized and converted -# to native line endings on checkout. -.gitignore text -.gitattributes text -*.xml text -*.yml text -*.yaml text -*.json text -*.txt text -*.md text -*.htm text -*.html text -*.xhtml text -*.js text -*.ts text -*.css text -*.less text -*.scss text -*.cfg text -LICENSE text - -# Declare files that will always have CRLF line endings on checkout. -*.bat text eol=crlf -*.cmd text eol=crlf - -# Declare files that will always have LF line endings on checkout. -*.sh text eol=lf -*.service eol=lf -*.conf eol=lf -*.desktop eol=lf -*.j2 eol=lf - -# Denote all files that are truly binary and should not be modified. -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.eot binary -*.tff binary -*.woff binary diff --git a/roles/gantsign.default-web-browser/.gitignore b/roles/gantsign.default-web-browser/.gitignore deleted file mode 100644 index 3cd9859..0000000 --- a/roles/gantsign.default-web-browser/.gitignore +++ /dev/null @@ -1,250 +0,0 @@ -# Created by https://www.gitignore.io/api/windows,linux,osx,vim,emacs,intellij,eclipse,visualstudiocode,ansible - -### Windows ### -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - - -### OSX ### -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### Vim ### -# swap -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -# session -Session.vim -# temporary -.netrwhist -*~ -# auto-generated tag files -tags - - -### Emacs ### -# -*- mode: gitignore; -*- -*~ -\#*\# -/.emacs.desktop -/.emacs.desktop.lock -*.elc -auto-save-list -tramp -.\#* - -# Org-mode -.org-id-locations -*_archive - -# flymake-mode -*_flymake.* - -# eshell files -/eshell/history -/eshell/lastdir - -# elpa packages -/elpa/ - -# reftex files -*.rel - -# AUCTeX auto folder -/auto/ - -# cask packages -.cask/ -dist/ - -# Flycheck -flycheck_*.el - -# server auth directory -/server/ - -# projectiles files -.projectile - -### Intellij ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea/workspace.xml -.idea/tasks.xml -.idea/dictionaries -.idea/vcs.xml -.idea/jsLibraryMappings.xml - -# Sensitive or high-churn files: -.idea/dataSources.ids -.idea/dataSources.xml -.idea/dataSources.local.xml -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml - -# Gradle: -.idea/gradle.xml -.idea/libraries - -# Mongo Explorer plugin: -.idea/mongoSettings.xml - -## File-based project format: -*.iws - -## Plugin-specific files: - -# IntelliJ -/out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -### Intellij Patch ### -# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 - -# *.iml -# modules.xml -# .idea/misc.xml -# *.ipr - - -### Eclipse ### - -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# Eclipse Core -.project - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# JDT-specific (Eclipse Java Development Tools) -.classpath - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json - - -### Ansible ### -*.retry - -#################### -### Custom rules ### -#################### - -### Molecule ### - -__pycache__ -.cache -.molecule diff --git a/roles/gantsign.default-web-browser/.moleculew/ansible_version b/roles/gantsign.default-web-browser/.moleculew/ansible_version deleted file mode 100644 index 2714f53..0000000 --- a/roles/gantsign.default-web-browser/.moleculew/ansible_version +++ /dev/null @@ -1 +0,0 @@ -2.6.4 diff --git a/roles/gantsign.default-web-browser/.moleculew/docker_lib_version b/roles/gantsign.default-web-browser/.moleculew/docker_lib_version deleted file mode 100644 index 1545d96..0000000 --- a/roles/gantsign.default-web-browser/.moleculew/docker_lib_version +++ /dev/null @@ -1 +0,0 @@ -3.5.0 diff --git a/roles/gantsign.default-web-browser/.moleculew/molecule_version b/roles/gantsign.default-web-browser/.moleculew/molecule_version deleted file mode 100644 index d76bd2b..0000000 --- a/roles/gantsign.default-web-browser/.moleculew/molecule_version +++ /dev/null @@ -1 +0,0 @@ -2.17.0 diff --git a/roles/gantsign.default-web-browser/.moleculew/python_version b/roles/gantsign.default-web-browser/.moleculew/python_version deleted file mode 100644 index f24054f..0000000 --- a/roles/gantsign.default-web-browser/.moleculew/python_version +++ /dev/null @@ -1 +0,0 @@ -2.7.15 diff --git a/roles/gantsign.default-web-browser/.travis.yml b/roles/gantsign.default-web-browser/.travis.yml deleted file mode 100644 index 553538f..0000000 --- a/roles/gantsign.default-web-browser/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -language: python -python: '2.7' - -env: - global: - - MOLECULEW_USE_SYSTEM=true - matrix: - # Spin off separate builds for each of the following versions of Ansible - - MOLECULEW_ANSIBLE=2.4.6 - - MOLECULEW_ANSIBLE=2.6.3 - -# Require the standard build environment -sudo: required - -# Require Ubuntu 14.04 -dist: trusty - -# Require Docker -services: - - docker - -install: - # Install dependencies - - ./moleculew wrapper-install - - # Display versions - - ./moleculew wrapper-versions - -script: - - ./moleculew test - -branches: - only: - - master - - /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([\.\-].*)?$/ - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/gantsign.default-web-browser/.yamllint b/roles/gantsign.default-web-browser/.yamllint deleted file mode 100644 index 77be3fb..0000000 --- a/roles/gantsign.default-web-browser/.yamllint +++ /dev/null @@ -1,13 +0,0 @@ -extends: default - -rules: - braces: - max-spaces-inside: 1 - level: error - brackets: - max-spaces-inside: 1 - level: error - line-length: disable - # NOTE(retr0h): Templates no longer fail this lint rule. - # Uncomment if running old Molecule templates. - truthy: disable diff --git a/roles/gantsign.default-web-browser/LICENSE b/roles/gantsign.default-web-browser/LICENSE deleted file mode 100644 index 63fe56b..0000000 --- a/roles/gantsign.default-web-browser/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 GantSign Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/gantsign.default-web-browser/README.md b/roles/gantsign.default-web-browser/README.md deleted file mode 100644 index c1758c1..0000000 --- a/roles/gantsign.default-web-browser/README.md +++ /dev/null @@ -1,103 +0,0 @@ -Ansible Role: Default Web Browser -================================= - -[![Build Status](https://travis-ci.org/gantsign/ansible-role-default-web-browser.svg?branch=master)](https://travis-ci.org/gantsign/ansible-role-default-web-browser) -[![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-gantsign.default--web--browser-blue.svg)](https://galaxy.ansible.com/gantsign/default-web-browser) -[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/gantsign/ansible-role-default-web-browser/master/LICENSE) - -This role sets the default web browser for Ubuntu Unity and Xfce4. - -Requirements ------------- - -* Ansible - - * Minimum 2.4 - -* Ubuntu - - * Xenial (16.04) - * Bionic (18.04) - -* Supported desktop - - * Gnome - - * Ubuntu Unity - - * Xfce4 (i.e. the desktop on XUbuntu) - -* Installed web browser - - * This role doesn't install the web browser; you need to have already - installed your chosen web browser before using this role. - -Role Variables --------------- - -The following variables will change the behavior of this role (default values -are shown below): - -```yaml -# The web browser to make the default (i.e. the name of the .desktop file without the extension) -default_web_browser: google-chrome -``` - -Example Playbook ----------------- - -```yaml -- hosts: servers - roles: - - role: gantsign.default-web-browser - default_web_browser: google-chrome -``` - -More Roles From GantSign ------------------------- - -You can find more roles from GantSign on -[Ansible Galaxy](https://galaxy.ansible.com/gantsign). - -Development & Testing ---------------------- - -This project uses [Molecule](http://molecule.readthedocs.io/) to aid in the -development and testing; the role is unit tested using -[Testinfra](http://testinfra.readthedocs.io/) and -[pytest](http://docs.pytest.org/). - -To develop or test you'll need to have installed the following: - -* Linux (e.g. [Ubuntu](http://www.ubuntu.com/)) -* [Docker](https://www.docker.com/) -* [Python](https://www.python.org/) (including python-pip) -* [Ansible](https://www.ansible.com/) -* [Molecule](http://molecule.readthedocs.io/) - -Because the above can be tricky to install, this project includes -[Molecule Wrapper](https://github.com/gantsign/molecule-wrapper). Molecule -Wrapper is a shell script that installs Molecule and it's dependencies (apart -from Linux) and then executes Molecule with the command you pass it. - -To test this role using Molecule Wrapper run the following command from the -project root: - -```bash -./moleculew test -``` - -Note: some of the dependencies need `sudo` permission to install. - -License -------- - -MIT - -Author Information ------------------- - -John Freeman - -GantSign Ltd. -Company No. 06109112 (registered in England) diff --git a/roles/gantsign.default-web-browser/defaults/main.yml b/roles/gantsign.default-web-browser/defaults/main.yml deleted file mode 100644 index 036a19b..0000000 --- a/roles/gantsign.default-web-browser/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# The web browser to make the default (i.e. the name of the .desktop file without the extension) -default_web_browser: google-chrome - -root_user: root diff --git a/roles/gantsign.default-web-browser/handlers/main.yml b/roles/gantsign.default-web-browser/handlers/main.yml deleted file mode 100644 index 06f8774..0000000 --- a/roles/gantsign.default-web-browser/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ansible-role-default-web-browser diff --git a/roles/gantsign.default-web-browser/meta/.galaxy_install_info b/roles/gantsign.default-web-browser/meta/.galaxy_install_info deleted file mode 100644 index 624371f..0000000 --- a/roles/gantsign.default-web-browser/meta/.galaxy_install_info +++ /dev/null @@ -1 +0,0 @@ -{install_date: 'Thu Sep 27 06:39:09 2018', version: 3.2.0} diff --git a/roles/gantsign.default-web-browser/meta/main.yml b/roles/gantsign.default-web-browser/meta/main.yml deleted file mode 100644 index 0b55e81..0000000 --- a/roles/gantsign.default-web-browser/meta/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -galaxy_info: - author: John Freeman - description: Role for setting the default web browser for Ubuntu Unity and Xfce4. - company: GantSign Ltd. - license: MIT - min_ansible_version: 2.4 - platforms: - - name: Ubuntu - versions: - - xenial - - bionic - galaxy_tags: - - ubuntu - - unity - - xfce4 - - xubuntu - - browser - - system -dependencies: [] diff --git a/roles/gantsign.default-web-browser/molecule/default/Dockerfile.j2 b/roles/gantsign.default-web-browser/molecule/default/Dockerfile.j2 deleted file mode 100644 index 9f689d9..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/Dockerfile.j2 +++ /dev/null @@ -1,13 +0,0 @@ -# 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 upgrade -y && 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 python2-dnf bash && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && 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 update -y && 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; fi diff --git a/roles/gantsign.default-web-browser/molecule/default/INSTALL.rst b/roles/gantsign.default-web-browser/molecule/default/INSTALL.rst deleted file mode 100644 index e26493b..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/INSTALL.rst +++ /dev/null @@ -1,16 +0,0 @@ -******* -Install -******* - -Requirements -============ - -* Docker Engine -* docker-py - -Install -======= - -.. code-block:: bash - - $ sudo pip install docker-py diff --git a/roles/gantsign.default-web-browser/molecule/default/create.yml b/roles/gantsign.default-web-browser/molecule/default/create.yml deleted file mode 100644 index 45d222e..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/create.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -- name: Create - hosts: localhost - connection: local - gather_facts: false - no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}" - tasks: - - name: Log into a Docker registry - docker_login: - username: "{{ item.registry.credentials.username }}" - password: "{{ item.registry.credentials.password }}" - email: "{{ item.registry.credentials.email | default(omit) }}" - registry: "{{ item.registry.url }}" - with_items: "{{ molecule_yml.platforms }}" - when: - - item.registry is defined - - item.registry.credentials is defined - - item.registry.credentials.username is defined - - - name: Create Dockerfiles from image names - template: - src: "{{ molecule_scenario_directory }}/Dockerfile.j2" - dest: "{{ molecule_ephemeral_directory }}/Dockerfile_{{ item.image | regex_replace('[^a-zA-Z0-9_]', '_') }}" - with_items: "{{ molecule_yml.platforms }}" - register: platforms - - - name: Discover local Docker images - docker_image_facts: - name: "molecule_local/{{ item.item.name }}" - with_items: "{{ platforms.results }}" - register: docker_images - - - name: Build an Ansible compatible image - docker_image: - path: "{{ molecule_ephemeral_directory }}" - name: "molecule_local/{{ item.item.image }}" - dockerfile: "{{ item.item.dockerfile | default(item.invocation.module_args.dest) }}" - force: "{{ item.item.force | default(true) }}" - with_items: "{{ platforms.results }}" - when: platforms.changed or docker_images.results | map(attribute='images') | select('equalto', []) | list | count >= 0 - - - name: Create docker network(s) - docker_network: - name: "{{ item }}" - state: present - with_items: "{{ molecule_yml.platforms | molecule_get_docker_networks }}" - - - name: Create molecule instance(s) - docker_container: - name: "{{ item.name }}" - hostname: "{{ item.name }}" - image: "molecule_local/{{ item.image }}" - state: started - recreate: false - log_driver: json-file - command: "{{ item.command | default('bash -c \"while true; do sleep 10000; done\"') }}" - privileged: "{{ item.privileged | default(omit) }}" - volumes: "{{ item.volumes | default(omit) }}" - capabilities: "{{ item.capabilities | default(omit) }}" - exposed_ports: "{{ item.exposed_ports | default(omit) }}" - published_ports: "{{ item.published_ports | default(omit) }}" - ulimits: "{{ item.ulimits | default(omit) }}" - networks: "{{ item.networks | default(omit) }}" - dns_servers: "{{ item.dns_servers | default(omit) }}" - register: server - with_items: "{{ molecule_yml.platforms }}" - async: 7200 - poll: 0 - - - name: Wait for instance(s) creation to complete - async_status: - jid: "{{ item.ansible_job_id }}" - register: docker_jobs - until: docker_jobs.finished - retries: 300 - with_items: "{{ server.results }}" diff --git a/roles/gantsign.default-web-browser/molecule/default/destroy.yml b/roles/gantsign.default-web-browser/molecule/default/destroy.yml deleted file mode 100644 index 7ba7d28..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/destroy.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- name: Destroy - hosts: localhost - connection: local - gather_facts: false - no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}" - tasks: - - name: Destroy molecule instance(s) - docker_container: - name: "{{ item.name }}" - state: absent - force_kill: "{{ item.force_kill | default(true) }}" - register: server - with_items: "{{ molecule_yml.platforms }}" - async: 7200 - poll: 0 - - - name: Wait for instance(s) deletion to complete - async_status: - jid: "{{ item.ansible_job_id }}" - register: docker_jobs - until: docker_jobs.finished - retries: 300 - with_items: "{{ server.results }}" - - - name: Delete docker network(s) - docker_network: - name: "{{ item }}" - state: absent - with_items: "{{ molecule_yml.platforms | molecule_get_docker_networks }}" diff --git a/roles/gantsign.default-web-browser/molecule/default/molecule.yml b/roles/gantsign.default-web-browser/molecule/default/molecule.yml deleted file mode 100644 index a261fe7..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/molecule.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -dependency: - name: galaxy - -driver: - name: docker - -lint: - name: yamllint - -platforms: - - name: ansible-role-default-web-browser-ubuntu-min - image: ubuntu:16.04 - - name: ansible-role-default-web-browser-ubuntu-max - image: ubuntu:18.04 - -provisioner: - name: ansible - lint: - name: ansible-lint - -scenario: - name: default - -verifier: - name: testinfra - lint: - name: flake8 diff --git a/roles/gantsign.default-web-browser/molecule/default/playbook.yml b/roles/gantsign.default-web-browser/molecule/default/playbook.yml deleted file mode 100644 index 98a8202..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/playbook.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Converge - hosts: all - - pre_tasks: - - name: create applications directory - become: yes - file: - path: '{{ default_web_browser_applications_dir }}' - state: directory - owner: root - group: root - mode: 'u=rwx,go=rx' - - - name: create desktop file - become: yes - copy: - content: 'Exec=/usr/bin/google-chrome-stable %U' - dest: '{{ default_web_browser_applications_dir }}/google-chrome.desktop' - owner: root - group: root - mode: 'u=rwx,go=rx' - - roles: - - ansible-role-default-web-browser diff --git a/roles/gantsign.default-web-browser/molecule/default/prepare.yml b/roles/gantsign.default-web-browser/molecule/default/prepare.yml deleted file mode 100644 index 5358b3b..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/prepare.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Prepare - hosts: all - gather_facts: false - tasks: [] diff --git a/roles/gantsign.default-web-browser/molecule/default/tests/test_gnome.py b/roles/gantsign.default-web-browser/molecule/default/tests/test_gnome.py deleted file mode 100644 index f728ba5..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/tests/test_gnome.py +++ /dev/null @@ -1,32 +0,0 @@ -import pytest -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_mimeapps_file_permissions(host): - config = host.file('/etc/xdg/ansible-default-web-browser/mimeapps.list') - - assert config.exists - assert config.is_file - assert config.user == 'root' - assert config.group == 'root' - assert oct(config.mode) == '0644' - - -@pytest.mark.parametrize('expected', [ - 'text/html=google-chrome.desktop', - 'x-scheme-handler/http=google-chrome.desktop', - 'x-scheme-handler/https=google-chrome.desktop', - 'x-scheme-handler/about=google-chrome.desktop', - 'x-scheme-handler/unknown=google-chrome.desktop' -]) -def test_mimeapps_file(host, expected): - config = host.file('/etc/xdg/ansible-default-web-browser/mimeapps.list') - - assert config.exists - assert config.is_file - assert config.contains(expected) diff --git a/roles/gantsign.default-web-browser/molecule/default/tests/test_xfce4.py b/roles/gantsign.default-web-browser/molecule/default/tests/test_xfce4.py deleted file mode 100644 index 9ca969e..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/tests/test_xfce4.py +++ /dev/null @@ -1,44 +0,0 @@ -import pytest -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_helpers_file_permissions(host): - config = host.file('/etc/xdg/ansible-default-web-browser/xfce4/helpers.rc') - - assert config.exists - assert config.is_file - assert config.user == 'root' - assert config.group == 'root' - assert oct(config.mode) == '0644' - assert config.contains('WebBrowser=google-chrome') - - -def test_desktop_file_permissions(host): - helper_dir = '/etc/xdg/ansible-default-web-browser/xfce4/helpers' - desktop = host.file(helper_dir + '/google-chrome.desktop') - - assert desktop.exists - assert desktop.is_file - assert desktop.user == 'root' - assert desktop.group == 'root' - assert oct(desktop.mode) == '0644' - - -@pytest.mark.parametrize('expected', [ - 'Type=X-XFCE-Helper', - 'X-XFCE-Category=WebBrowser', - 'X-XFCE-Commands=/usr/bin/google-chrome-stable', - 'X-XFCE-CommandsWithParameter=/usr/bin/google-chrome-stable "%s"' -]) -def test_desktop_file(host, expected): - helper_dir = '/etc/xdg/ansible-default-web-browser/xfce4/helpers' - desktop = host.file(helper_dir + '/google-chrome.desktop') - - assert desktop.exists - assert desktop.is_file - assert desktop.contains(expected) diff --git a/roles/gantsign.default-web-browser/molecule/default/tests/test_xsession.py b/roles/gantsign.default-web-browser/molecule/default/tests/test_xsession.py deleted file mode 100644 index 195f11e..0000000 --- a/roles/gantsign.default-web-browser/molecule/default/tests/test_xsession.py +++ /dev/null @@ -1,29 +0,0 @@ -import pytest -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_xsession_file_permissions(host): - config = host.file('/etc/X11/Xsession.d/80-ansible-default-web-browser') - - assert config.exists - assert config.is_file - assert config.user == 'root' - assert config.group == 'root' - assert oct(config.mode) == '0644' - - -@pytest.mark.parametrize('expected', [ - 'XDG_CONFIG_DIRS=/etc/xdg/ansible-default-web-browser:"$XDG_CONFIG_DIRS"', - 'XDG_DATA_DIRS=/etc/xdg/ansible-default-web-browser:"$XDG_DATA_DIRS"' -]) -def test_xsession_file(host, expected): - config = host.file('/etc/X11/Xsession.d/80-ansible-default-web-browser') - - assert config.exists - assert config.is_file - assert config.contains(expected) diff --git a/roles/gantsign.default-web-browser/moleculew b/roles/gantsign.default-web-browser/moleculew deleted file mode 100755 index 9a81fd6..0000000 --- a/roles/gantsign.default-web-browser/moleculew +++ /dev/null @@ -1,792 +0,0 @@ -#!/usr/bin/env bash - -# MIT License -# -# Copyright (c) 2018 GantSign Ltd. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - -# Molecule Wrapper the wrapper script for Molecule -# https://github.com/gantsign/molecule-wrapper - -set -e - -WRAPPER_VERSION=0.9.9 - -VERSION_DIR='.moleculew' -PYTHON_VERSION_FILE="$VERSION_DIR/python_version" -ANSIBLE_VERSION_FILE="$VERSION_DIR/ansible_version" -DOCKER_LIB_VERSION_FILE="$VERSION_DIR/docker_lib_version" -MOLECULE_VERSION_FILE="$VERSION_DIR/molecule_version" - -BUILD_DEPENDENCIES_INSTALLLED=false -PYENV_INSTALLED=false - -ANSIBLE_VERSION='' -DOCKER_LIB_VERSION='' -MOLECULE_VERSION='' -PYTHON_VERSION='' -USE_SYSTEM_DEPENDENCIES=false - -PRE_ARGS=() -MOLECULE_CMD='' -POST_ARGS=() - -export PATH="$HOME/.pyenv/bin:$HOME/.local/bin:$PATH" - -hr() { - for ((i = 1; i <= 80; i++)); do - printf '*' - done - echo '' -} - -banner() { - hr - echo "$1" - hr -} - -run_as_root() { - if [[ $EUID -eq 0 ]]; then - "$@" - elif [ -x "$(command -v sudo)" ]; then - sudo "$@" - else - echo "Error: sudo is not installed" >&2 - exit 1 - fi -} - -build_dependencies_present() { - if [[ $BUILD_DEPENDENCIES_INSTALLLED == true ]]; then - return - fi - if [[ $USE_SYSTEM_DEPENDENCIES == true ]]; then - return - fi - # https://github.com/pyenv/pyenv/wiki/common-build-problems - if [[ -x "$(command -v apt-get)" ]]; then - banner 'Installing build dependencies' - - run_as_root apt-get update - run_as_root apt-get install --assume-yes \ - make build-essential libssl-dev zlib1g-dev libbz2-dev \ - libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ - libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev \ - git jq - echo '' - elif [[ -x "$(command -v dnf)" ]]; then - banner 'Installing build dependencies' - - run_as_root dnf install \ - zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel \ - openssl-devel xz xz-devel libffi-devel \ - git which curl jq - echo '' - elif [[ -x "$(command -v yum)" ]]; then - banner 'Installing build dependencies' - - run_as_root yum install \ - zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel \ - openssl-devel xz xz-devel libffi-devel \ - git which curl jq - echo '' - elif [[ -x "$(command -v zypper)" ]]; then - banner 'Installing build dependencies' - - run_as_root zypper install \ - zlib-devel bzip2 libbz2-devel readline-devel sqlite3 sqlite3-devel \ - libopenssl-devel xz xz-devel \ - git which curl jq - echo '' - fi - BUILD_DEPENDENCIES_INSTALLLED=true -} - -pyenv_present() { - if [[ $PYENV_INSTALLED == true ]]; then - return - fi - if [[ $USE_SYSTEM_DEPENDENCIES == true ]]; then - return - fi - if [[ -x "$(command -v pyenv)" ]]; then - PYENV_INSTALLED=true - return - fi - - build_dependencies_present - - banner "Installing pyenv for user $USER" - bash <(curl --location https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer) - echo '' - PYENV_INSTALLED=true -} - -query_latest_python_version2() { - pyenv_present - - PYTHON_VERSION="$(~/.pyenv/plugins/python-build/bin/python-build --definitions | grep --color=never '^2\.' | grep --invert-match '\-dev$' | tail -1)" -} - -query_latest_python_version3() { - pyenv_present - - PYTHON_VERSION="$(~/.pyenv/plugins/python-build/bin/python-build --definitions | grep --color=never '^3\.' | grep --invert-match '\-dev$' | tail -1)" -} - -query_latest_package_version() { - if [[ ! -x "$(command -v curl)" ]]; then - build_dependencies_present - fi - if [[ ! -x "$(command -v jq)" ]]; then - build_dependencies_present - fi - if [[ ! -x "$(command -v curl)" ]]; then - echo 'Error: curl is not installed.' >&2 - exit 1 - fi - if [[ ! -x "$(command -v jq)" ]]; then - echo 'Error: jq is not installed.' >&2 - exit 1 - fi - - local version - # shellcheck disable=SC2034 - version=$(curl --fail --silent --show-error --location "https://pypi.org/pypi/$2/json" | jq --raw-output '.info.version') - - eval "$1=\"\$version\"" -} - -docker_present() { - if [[ -x "$(command -v docker)" ]]; then - return - fi - if [[ $USE_SYSTEM_DEPENDENCIES == true ]]; then - echo 'Error: docker is not installed.' >&2 - exit 1 - fi - - build_dependencies_present - - banner 'Installing Docker' - sh <(curl --fail --silent --show-error --location https://get.docker.com) - run_as_root usermod --append --groups docker "$USER" - banner "User '$USER' has been added to the 'docker' group. Logout/restart and log back in for changes to take effect." - exit -} - -python_present() { - if [[ $PYTHON_VERSION == system ]]; then - if [[ ! -x "$(command -v python)" ]]; then - echo 'Error: python is not installed.' >&2 - exit 1 - fi - if [[ ! -x "$(command -v pip)" ]]; then - echo 'Error: pip is not installed.' >&2 - exit 1 - fi - if [[ ! -x "$(command -v which)" ]]; then - echo 'Error: which is not installed.' >&2 - exit 1 - fi - PYTHON_EXE="$(which python)" - else - if [[ ! -x "$(command -v git)" ]]; then - echo 'Error: git is not installed.' >&2 - exit 1 - fi - - pyenv_present - - export PYENV_VERSION="$PYTHON_VERSION" - if [[ ! -d "$HOME/.pyenv/versions/$PYTHON_VERSION" ]]; then - build_dependencies_present - - banner "Making Python version $PYTHON_VERSION available using pyenv" - pyenv install "$PYTHON_VERSION" - echo '' - fi - eval "$(pyenv init -)" - PYTHON_EXE="$(pyenv which python)" - fi -} - -virtualenv_presant() { - if [[ ! -x "$(command -v virtualenv)" ]]; then - banner "Installing virtualenv for user $USER" - pip install --user virtualenv - echo '' - fi -} - -install_ansible() { - banner "Installing Ansible $ANSIBLE_VERSION into virtualenv $VIRTUAL_ENV" - pip install "ansible==$ANSIBLE_VERSION" - echo '' -} - -install_docker_lib() { - banner "Installing Python Docker $DOCKER_LIB_VERSION into virtualenv $VIRTUAL_ENV" - pip install "docker==$DOCKER_LIB_VERSION" - echo '' -} - -install_molecule() { - banner "Installing Molecule $MOLECULE_VERSION into virtualenv $VIRTUAL_ENV" - pip install "molecule==$MOLECULE_VERSION" - echo '' -} - -wrapper_clean() { - local MOLECULE_WRAPPER_HOME="$HOME/.moleculew" - read -r -p "Delete ${MOLECULE_WRAPPER_HOME} (y/n)? " yn - case $yn in - [Yy]|YES|yes|Yes) - rm -rf "$MOLECULE_WRAPPER_HOME"; - exit - ;; - *) - exit - ;; - esac -} - -wrapper_upgrade() { - curl --fail --silent --show-error --location --output moleculew.new \ - 'https://raw.githubusercontent.com/gantsign/molecule-wrapper/master/moleculew' \ - && chmod 'u+x' moleculew.new \ - && mv --force moleculew.new moleculew - - local NEW_VERSION - NEW_VERSION="$(./moleculew wrapper-version)" - if [ "$WRAPPER_VERSION" != "$NEW_VERSION" ]; then - echo "Upgraded wrapper from version $WRAPPER_VERSION to $NEW_VERSION" - else - echo "You are already using the latest version" - fi - exit -} - -wrapper_version() { - echo "$WRAPPER_VERSION" - exit -} - -print_versions() { - echo "Python: $PYTHON_VERSION" - echo "Ansible: $ANSIBLE_VERSION" - echo "Python Docker library: $DOCKER_LIB_VERSION" - echo "Molecule: $MOLECULE_VERSION" -} - -wrapper_versions() { - detemine_versions - - print_versions - exit -} - -wrapper_freeze() { - detemine_versions - - banner 'Freezing versions' - - mkdir -p "$VERSION_DIR" - - echo "$PYTHON_VERSION" > "$PYTHON_VERSION_FILE" - echo "$ANSIBLE_VERSION" > "$ANSIBLE_VERSION_FILE" - echo "$DOCKER_LIB_VERSION" > "$DOCKER_LIB_VERSION_FILE" - echo "$MOLECULE_VERSION" > "$MOLECULE_VERSION_FILE" - - print_versions - - exit -} - -wrapper_unfreeze() { - banner 'Un-freezing versions' - - if [[ -f "$PYTHON_VERSION_FILE" ]]; then - rm --verbose "$PYTHON_VERSION_FILE" - fi - if [[ -f "$ANSIBLE_VERSION_FILE" ]]; then - rm --verbose "$ANSIBLE_VERSION_FILE" - fi - if [[ -f "$DOCKER_LIB_VERSION_FILE" ]]; then - rm --verbose "$DOCKER_LIB_VERSION_FILE" - fi - if [[ -f "$MOLECULE_VERSION_FILE" ]]; then - rm --verbose "$MOLECULE_VERSION_FILE" - fi - exit -} - -wrapper_upgrade_versions() { - detemine_versions - - banner 'Upgrading versions' - - local CURRENT_PYTHON_VERSION="$PYTHON_VERSION" - local CURRENT_ANSIBLE_VERSION="$ANSIBLE_VERSION" - local CURRENT_DOCKER_LIB_VERSION="$DOCKER_LIB_VERSION" - local CURRENT_MOLECULE_VERSION="$MOLECULE_VERSION" - - query_latest_python_version2 - query_latest_package_version ANSIBLE_VERSION ansible - query_latest_package_version DOCKER_LIB_VERSION docker - query_latest_package_version MOLECULE_VERSION molecule - echo '' - - echo 'New versions:' - if [[ "$CURRENT_PYTHON_VERSION" == "$PYTHON_VERSION" ]]; then - echo "Python: $CURRENT_PYTHON_VERSION (no change)" - else - echo "Python: $CURRENT_PYTHON_VERSION -> $PYTHON_VERSION" - fi - - if [[ "$CURRENT_ANSIBLE_VERSION" == "$ANSIBLE_VERSION" ]]; then - echo "Ansible: $CURRENT_ANSIBLE_VERSION (no change)" - else - echo "Ansible: $CURRENT_ANSIBLE_VERSION -> $ANSIBLE_VERSION" - fi - - if [[ "$CURRENT_DOCKER_LIB_VERSION" == "$DOCKER_LIB_VERSION" ]]; then - echo "Python Docker library: $CURRENT_DOCKER_LIB_VERSION (no change)" - else - echo "Python Docker library: $CURRENT_DOCKER_LIB_VERSION -> $DOCKER_LIB_VERSION" - fi - - if [[ "$CURRENT_MOLECULE_VERSION" == "$MOLECULE_VERSION" ]]; then - echo "Molecule: $CURRENT_MOLECULE_VERSION (no change)" - else - echo "Molecule: $CURRENT_MOLECULE_VERSION -> $MOLECULE_VERSION" - fi - echo '' - - wrapper_freeze -} - -wrapper_help() { - activate_virtualenv - - molecule --help - - echo " -Molecule Wrapper - -Additional options: - --ansible VERSION Use the specified version of Ansible - --docker-lib VERSION Use the specified version of the Python Docker - library - --molecule VERSION Use the specified version of Molecule - --python VERSION Use the specified version of Python - --use-system-dependencies Use system dependencies - -Additional commands: - wrapper-clean Removes all the wrapper virtual environments - wrapper-freeze Freezes the dependency versions being used - wrapper-unfreeze Un-freezes the dependency versions - wrapper-upgrade Upgrades the Molecule Wrapper to the latest version - wrapper-upgrade-versions Upgrades any frozen dependency versions - wrapper-version Displays the current version of Molecule Wrapper -" -} - -query_package_versions() { - local package_name="$1" - local min_version="$2" - - if [[ ! -x "$(command -v curl)" ]]; then - build_dependencies_present > /dev/null - fi - if [[ ! -x "$(command -v jq)" ]]; then - build_dependencies_present > /dev/null - fi - if [[ ! -x "$(command -v curl)" ]]; then - echo 'Error: curl is not installed.' >&2 - exit 1 - fi - if [[ ! -x "$(command -v jq)" ]]; then - echo 'Error: jq is not installed.' >&2 - exit 1 - fi - if [[ ! -x "$(command -v sort)" ]]; then - echo 'Error: sort is not installed.' >&2 - exit 1 - fi - - for i in $(curl --fail --silent --show-error \ - --location "https://pypi.org/pypi/$package_name/json" \ - | jq --raw-output ".releases | keys | .[], \"$min_version.\"" \ - | grep --invert-match '[a-zA-Z]' \ - | sort --version-sort --reverse) ; do - if [[ "$i" == "$min_version." ]]; then - break - fi - echo "$i" - done -} - -wrapper_options_ansible() { - echo 'latest' - query_package_versions 'ansible' '2.2' -} - -wrapper_options_docker_lib() { - echo 'latest' - query_package_versions 'docker' '3.0' -} - -wrapper_options_molecule() { - echo 'latest' - query_package_versions 'molecule' '2.0' -} - -wrapper_options_python() { - if [[ ! -x "$(command -v sort)" ]]; then - echo 'Error: sort is not installed.' >&2 - exit 1 - fi - - pyenv_present > /dev/null - - local min_version='2.7' - - echo 'latest' - - for i in $( (echo "$min_version." && \ - ~/.pyenv/plugins/python-build/bin/python-build --definitions) \ - | grep --color=never '^[0-9]' \ - | grep --invert-match '\-dev$' \ - | sort --version-sort --reverse) ; do - if [[ "$i" == "$min_version." ]]; then - break - fi - echo "$i" - done -} - -wrapper_options_scenario() { - if [ -f 'moleculew' ]; then - activate_virtualenv > /dev/null - fi - python << EOF -import os -import sys - -import six -import yaml - - -molecule_dir = 'molecule' -if not os.path.isdir(molecule_dir): - sys.exit() - -scenarios = [] -default = False - -for filename in os.listdir(molecule_dir): - scenario_dir = os.path.join(molecule_dir, filename) - if not os.path.isdir(scenario_dir): - continue - - molecule_yaml = os.path.join(scenario_dir, 'molecule.yml') - if not os.path.isfile(molecule_yaml): - continue - - with open(molecule_yaml, 'r') as stream: - try: - contents = yaml.load(stream) - except yaml.YAMLError as exc: - continue - - if not isinstance(contents, dict): - continue - - scenario = contents.get('scenario') - if scenario is None: - continue - if not isinstance(scenario, dict): - continue - - name = scenario.get('name') - if name is None: - continue - if not isinstance(name, six.string_types): - continue - - if name == 'default': - default = True - else: - scenarios.append(name) - -scenarios.sort() -if default: - scenarios.append('default') - -for scenario in scenarios: - print(scenario) -EOF -} - -wrapper_virtualenv() { - activate_virtualenv > /dev/null - echo "$VIRTUAL_ENV" -} - -parse_args() { - set +e - - while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - --python=*) - PYTHON_VERSION="${1#*=}" - shift - ;; - --python) - shift - PYTHON_VERSION="$1" - shift - ;; - --ansible=*) - ANSIBLE_VERSION="${1#*=}" - shift - ;; - --ansible) - shift - ANSIBLE_VERSION="$1" - shift - ;; - --docker-lib=*) - DOCKER_LIB_VERSION="${1#*=}" - shift - ;; - --docker-lib) - shift - DOCKER_LIB_VERSION="$1" - shift - ;; - --molecule=*) - MOLECULE_VERSION="${1#*=}" - shift - ;; - --molecule) - shift - MOLECULE_VERSION="$1" - shift - ;; - --use-system-dependencies) - USE_SYSTEM_DEPENDENCIES=true - shift - ;; - --help) - MOLECULE_CMD='wrapper-help' - break - ;; - wrapper-*) - MOLECULE_CMD="$1" - shift - ;; - check|converge|create|dependency|destroy|idempotence|init|lint|list|login|matrix|prepare|side-effect|syntax|test|verify) - if [[ "$MOLECULE_CMD" != '' ]]; then - shift - else - MOLECULE_CMD="$1" - shift - for arg in "$@"; do - POST_ARGS+=("$arg") - done - break - fi - ;; - *) - PRE_ARGS+=("$1") - shift - ;; - esac - done - set -e -} - -detemine_versions() { - if [[ $USE_SYSTEM_DEPENDENCIES == false ]]; then - USE_SYSTEM_DEPENDENCIES="$MOLECULEW_USE_SYSTEM" - fi - if [[ $PYTHON_VERSION == '' ]]; then - PYTHON_VERSION="$MOLECULEW_PYTHON" - fi - if [[ $ANSIBLE_VERSION == '' ]]; then - ANSIBLE_VERSION="$MOLECULEW_ANSIBLE" - fi - if [[ $DOCKER_LIB_VERSION == '' ]]; then - DOCKER_LIB_VERSION="$MOLECULEW_DOCKER_LIB" - fi - if [[ $MOLECULE_VERSION == '' ]]; then - MOLECULE_VERSION="$MOLECULEW_MOLECULE" - fi - - if [[ $USE_SYSTEM_DEPENDENCIES == true ]]; then - if [[ $PYTHON_VERSION != '' ]]; then - echo "Error: --python and --use-system-dependencies cannot be used together" >&2 - exit 1 - fi - PYTHON_VERSION=system - elif [[ $PYTHON_VERSION == '' ]] || [[ $PYTHON_VERSION == 'default' ]]; then - if [[ -f $PYTHON_VERSION_FILE ]]; then - PYTHON_VERSION=$(<"$PYTHON_VERSION_FILE") - fi - if [[ $PYTHON_VERSION == '' ]]; then - query_latest_python_version2 - fi - elif [[ $PYTHON_VERSION == 'latest' ]] || [[ $PYTHON_VERSION == 'latest2' ]]; then - query_latest_python_version2 - elif [[ $PYTHON_VERSION == 'latest3' ]]; then - query_latest_python_version3 - fi - - if [[ $ANSIBLE_VERSION == '' ]] || [[ $ANSIBLE_VERSION == 'default' ]]; then - if [[ -f $ANSIBLE_VERSION_FILE ]]; then - ANSIBLE_VERSION=$(<"$ANSIBLE_VERSION_FILE") - fi - if [[ $ANSIBLE_VERSION == '' ]]; then - query_latest_package_version ANSIBLE_VERSION ansible - fi - elif [[ $ANSIBLE_VERSION == 'latest' ]]; then - query_latest_package_version ANSIBLE_VERSION ansible - fi - - if [[ $DOCKER_LIB_VERSION == '' ]] || [[ $DOCKER_LIB_VERSION == 'default' ]]; then - if [[ -f $DOCKER_LIB_VERSION_FILE ]]; then - DOCKER_LIB_VERSION=$(<"$DOCKER_LIB_VERSION_FILE") - fi - if [[ $DOCKER_LIB_VERSION == '' ]]; then - query_latest_package_version DOCKER_LIB_VERSION docker - fi - elif [[ $DOCKER_LIB_VERSION == 'latest' ]]; then - query_latest_package_version DOCKER_LIB_VERSION docker - fi - - if [[ $MOLECULE_VERSION == '' ]] || [[ $MOLECULE_VERSION == 'default' ]]; then - if [[ -f $MOLECULE_VERSION_FILE ]]; then - MOLECULE_VERSION=$(<$MOLECULE_VERSION_FILE) - fi - if [[ $MOLECULE_VERSION == '' ]]; then - query_latest_package_version MOLECULE_VERSION molecule - fi - elif [[ $MOLECULE_VERSION == 'latest' ]]; then - query_latest_package_version MOLECULE_VERSION molecule - fi -} - -activate_virtualenv() { - detemine_versions - - MOLECULE_WRAPPER_ENV="$HOME/.moleculew/molecule/$MOLECULE_VERSION/ansible/$ANSIBLE_VERSION/python/$PYTHON_VERSION/docker/$DOCKER_LIB_VERSION" - - if [ ! -d "$MOLECULE_WRAPPER_ENV" ]; then - - build_dependencies_present - - docker_present - - python_present - - virtualenv_presant - - banner "Initializing virtualenv $MOLECULE_WRAPPER_ENV" - virtualenv "--python=$PYTHON_EXE" "$MOLECULE_WRAPPER_ENV" - # shellcheck disable=SC1090 - source "$MOLECULE_WRAPPER_ENV/bin/activate" - echo '' - - install_ansible - - install_docker_lib - - install_molecule - else - # shellcheck disable=SC1090 - source "$MOLECULE_WRAPPER_ENV/bin/activate" - fi -} - -parse_args "$@" - -case $MOLECULE_CMD in - wrapper-clean) - wrapper_clean - ;; - wrapper-freeze) - wrapper_freeze - ;; - wrapper-help) - wrapper_help - ;; - wrapper-install) - activate_virtualenv - ;; - wrapper-options-ansible) - wrapper_options_ansible - ;; - wrapper-options-docker-lib) - wrapper_options_docker_lib - ;; - wrapper-options-molecule) - wrapper_options_molecule - ;; - wrapper-options-python) - wrapper_options_python - ;; - wrapper-options-scenario) - wrapper_options_scenario - ;; - wrapper-unfreeze) - wrapper_unfreeze - ;; - wrapper-upgrade) - wrapper_upgrade - ;; - wrapper-upgrade-versions) - wrapper_upgrade_versions - ;; - wrapper-version) - wrapper_version - ;; - wrapper-versions) - wrapper_versions - ;; - wrapper-virtualenv) - wrapper_virtualenv - ;; - wrapper-*) - echo "Unsupported command: $1" >&2 - exit 1 - ;; - *) - activate_virtualenv - - # shellcheck disable=SC2086 - exec molecule "${PRE_ARGS[@]}" $MOLECULE_CMD "${POST_ARGS[@]}" - ;; -esac diff --git a/roles/gantsign.default-web-browser/tasks/gnome.yml b/roles/gantsign.default-web-browser/tasks/gnome.yml deleted file mode 100644 index 0a08165..0000000 --- a/roles/gantsign.default-web-browser/tasks/gnome.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: create XDG applications directory - become: yes - become_user: "{{ root_user }}" - file: - path: '{{ default_web_browser_custom_config_dir }}' - state: directory - owner: root - group: root - mode: 'u=rwx,go=rx' - -- name: write mimeapps.list config - become: yes - become_user: "{{ root_user }}" - template: - src: mimeapps.list.j2 - dest: '{{ default_web_browser_custom_config_dir }}/mimeapps.list' - owner: root - group: root - mode: 'u=rw,go=r' diff --git a/roles/gantsign.default-web-browser/tasks/main.yml b/roles/gantsign.default-web-browser/tasks/main.yml deleted file mode 100644 index 2122f0e..0000000 --- a/roles/gantsign.default-web-browser/tasks/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- import_tasks: xsession.yml - -- import_tasks: gnome.yml - -- import_tasks: xfce4.yml diff --git a/roles/gantsign.default-web-browser/tasks/xfce4.yml b/roles/gantsign.default-web-browser/tasks/xfce4.yml deleted file mode 100644 index 1ce6072..0000000 --- a/roles/gantsign.default-web-browser/tasks/xfce4.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -- name: create custom Xfce4 config directory - become: yes - become_user: "{{ root_user }}" - file: - path: '{{ default_web_browser_custom_xfce4_dir }}' - state: directory - owner: root - group: root - mode: 'u=rwx,go=rx' - -- name: write helpers.rc - become: yes - become_user: "{{ root_user }}" - template: - src: helpers.rc.j2 - dest: '{{ default_web_browser_custom_xfce4_dir }}/helpers.rc' - owner: root - group: root - mode: 'u=rw,go=r' - -- name: create tmp directory - file: - path: '{{ remote_tmp }}' - state: directory - mode: 'u=rwx,go=' - -# Because lineinfile module doesn't have a insert_after_first param we're going -# to split the file in two and append to the first part before recombining. - -- name: copy first part of browser desktop file - shell: | - sed -e '/^Exec[=[]/,$d' "{{ default_web_browser_desktop_file }}" > "{{ default_web_browser_tmp_desktop_file_part1 }}" - args: - # No ansible module for splitting files - warn: false - check_mode: no - changed_when: no - -- name: copy second part of browser desktop file - shell: | - sed -n -e '/^Exec[=[]/,$p' "{{ default_web_browser_desktop_file }}" > "{{ default_web_browser_tmp_desktop_file_part2 }}" - args: - # No ansible module for splitting files - warn: false - check_mode: no - changed_when: no - -- name: set xfce4 type - lineinfile: - dest: '{{ item }}' - regexp: '^Type=' - line: Type=X-XFCE-Helper - state: present - with_items: - - '{{ default_web_browser_tmp_desktop_file_part1 }}' - - '{{ default_web_browser_tmp_desktop_file_part2 }}' - changed_when: no - -- name: set xfce4 category - lineinfile: - dest: '{{ default_web_browser_tmp_desktop_file_part1 }}' - regexp: '^X-XFCE-Category=' - line: X-XFCE-Category=WebBrowser - state: present - changed_when: no - -- name: query command with param from desktop file - shell: | - grep -E "^Exec(\[[^]=]*])?=" "{{ default_web_browser_desktop_file }}" | head -n 1 | cut -d= -f 2- | sed -e 's/%[FfUu]/"%s"/g' - register: browser_command_with_param - check_mode: no - changed_when: no - -- name: query command command_with_param - shell: 'echo "{{ browser_command_with_param.stdout }}" | { read first rest; echo "$first"; }' - register: browser_command - check_mode: no - changed_when: no - -- name: set xfce4 commands - lineinfile: - dest: '{{ default_web_browser_tmp_desktop_file_part1 }}' - regexp: '^X-XFCE-Commands=' - line: 'X-XFCE-Commands={{ browser_command.stdout }}' - state: present - changed_when: no - -- name: set xfce4 commands with param - lineinfile: - dest: '{{ default_web_browser_tmp_desktop_file_part1 }}' - regexp: '^X-XFCE-CommandsWithParameter=' - line: 'X-XFCE-CommandsWithParameter={{ browser_command_with_param.stdout }}' - state: present - changed_when: no - -- name: concatinate parts - shell: | - cat "{{ default_web_browser_tmp_desktop_file_part1 }}" \ - "{{ default_web_browser_tmp_desktop_file_part2 }}" \ - > "{{ default_web_browser_tmp_desktop_file }}" - check_mode: no - changed_when: no - -- name: create custom Xfce4 helpers directory - become: yes - become_user: "{{ root_user }}" - file: - path: '{{ default_web_browser_custom_xfce4_helpers_dir }}' - state: directory - owner: root - group: root - mode: 'u=rwx,go=rx' - -- name: copy browser desktop file - become: yes - become_user: "{{ root_user }}" - copy: - src: '{{ default_web_browser_tmp_desktop_file }}' - remote_src: yes - dest: '{{ default_web_browser_custom_xfce4_helpers_dir }}/{{ default_web_browser }}.desktop' - owner: root - group: root - mode: 'u=rw,go=r' diff --git a/roles/gantsign.default-web-browser/tasks/xsession.yml b/roles/gantsign.default-web-browser/tasks/xsession.yml deleted file mode 100644 index 2d3615a..0000000 --- a/roles/gantsign.default-web-browser/tasks/xsession.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: create Xsession.d directory - become: yes - become_user: "{{ root_user }}" - file: - path: '{{ default_web_browser_xsession_d_dir }}' - state: directory - owner: root - group: root - mode: 'u=rwx,go=rx' - -- name: write Xsession config - become: yes - become_user: "{{ root_user }}" - template: - src: x-session.j2 - dest: '{{ default_web_browser_xsession_d_dir }}/80-ansible-default-web-browser' - owner: root - group: root - mode: 'u=rw,go=r' diff --git a/roles/gantsign.default-web-browser/templates/helpers.rc.j2 b/roles/gantsign.default-web-browser/templates/helpers.rc.j2 deleted file mode 100644 index 43ea77f..0000000 --- a/roles/gantsign.default-web-browser/templates/helpers.rc.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{{ ansible_managed | comment }} - -WebBrowser={{ default_web_browser }} diff --git a/roles/gantsign.default-web-browser/templates/mimeapps.list.j2 b/roles/gantsign.default-web-browser/templates/mimeapps.list.j2 deleted file mode 100644 index 442d314..0000000 --- a/roles/gantsign.default-web-browser/templates/mimeapps.list.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{{ ansible_managed | comment }} - -[Default Applications] -text/html={{ default_web_browser }}.desktop -x-scheme-handler/http={{ default_web_browser }}.desktop -x-scheme-handler/https={{ default_web_browser }}.desktop -x-scheme-handler/about={{ default_web_browser }}.desktop -x-scheme-handler/unknown={{ default_web_browser }}.desktop diff --git a/roles/gantsign.default-web-browser/templates/x-session.j2 b/roles/gantsign.default-web-browser/templates/x-session.j2 deleted file mode 100644 index 5944e51..0000000 --- a/roles/gantsign.default-web-browser/templates/x-session.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{{ ansible_managed | comment }} - -XDG_CONFIG_DIRS={{ default_web_browser_custom_config_dir }}:"$XDG_CONFIG_DIRS" -export XDG_CONFIG_DIRS - -XDG_DATA_DIRS={{ default_web_browser_custom_config_dir }}:"$XDG_DATA_DIRS" -export XDG_DATA_DIRS diff --git a/roles/gantsign.default-web-browser/vars/main.yml b/roles/gantsign.default-web-browser/vars/main.yml deleted file mode 100644 index 30e09eb..0000000 --- a/roles/gantsign.default-web-browser/vars/main.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -# The tmp directory -remote_tmp: '{{ ansible_env.HOME }}/.ansible/tmp' - -# The directory where desktop files are stored -default_web_browser_applications_dir: /usr/share/applications - -# The directory for the custom XDG config -default_web_browser_custom_config_dir: /etc/xdg/ansible-default-web-browser - -# The directory where you can customize the Xsession config -default_web_browser_xsession_d_dir: /etc/X11/Xsession.d - -# The directory where custom Xfce4 config is stored -default_web_browser_custom_xfce4_dir: '{{ default_web_browser_custom_config_dir }}/xfce4' - -# The directory where custom Xfce4 helpers stored -default_web_browser_custom_xfce4_helpers_dir: '{{ default_web_browser_custom_xfce4_dir }}/helpers' - -# The the browser desktop file -default_web_browser_desktop_file: '{{ default_web_browser_applications_dir }}/{{ default_web_browser }}.desktop' - -# Temporary desktop file part 1 -default_web_browser_tmp_desktop_file_part1: '{{ remote_tmp }}/{{ default_web_browser }}.part1' - -# Temporary desktop file part 2 -default_web_browser_tmp_desktop_file_part2: '{{ remote_tmp }}/{{ default_web_browser }}.part2' - -# Temporary desktop file -default_web_browser_tmp_desktop_file: '{{ remote_tmp }}/{{ default_web_browser }}.desktop' diff --git a/roles/release_notes/defaults/main.yml b/roles/release_notes/defaults/main.yml index 1d82c8f..2a5f08c 100644 --- a/roles/release_notes/defaults/main.yml +++ b/roles/release_notes/defaults/main.yml @@ -3,5 +3,6 @@ # to see whether they should include release notes release_notes_locally: False -release_notes_vm: "${HOME}/Desktop/RELEASENOTES.txt" -release_notes_localhost: "{{ playbook_dir }}/RELEASENOTES.txt" +release_notes_vm_user: ubuntu +release_notes_vm: "/home/{{ release_notes_vm_user }}/Desktop/RELEASE_NOTES.txt" +release_notes_localhost: "{{ playbook_dir }}/RELEASE_NOTES.txt" diff --git a/roles/release_notes/tasks/main.yml b/roles/release_notes/tasks/main.yml index b87b760..2223a88 100644 --- a/roles/release_notes/tasks/main.yml +++ b/roles/release_notes/tasks/main.yml @@ -1,4 +1,6 @@ - name: "VM release notes: Add '{{ option }}' to '{{ section }}'" + become: true + become_user: "{{ release_notes_vm_user }}" ini_file: path: "{{ release_notes_vm }}" section: "{{ section }}"