-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for openSUSE 42.3 (#112)
Using `zypper` package manager.
- Loading branch information
Showing
11 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Molecule managed | ||
|
||
FROM {{ item.image }} | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
******* | ||
Install | ||
******* | ||
|
||
Requirements | ||
============ | ||
|
||
* Docker Engine | ||
* docker-py | ||
|
||
Install | ||
======= | ||
|
||
.. code-block:: bash | ||
$ sudo pip install docker-py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
|
||
driver: | ||
name: docker | ||
|
||
lint: | ||
name: yamllint | ||
|
||
platforms: | ||
- name: ansible-role-visual-studio-code-opensuse | ||
image: opensuse:42.3 | ||
|
||
provisioner: | ||
name: ansible | ||
playbooks: | ||
create: ../default/create.yml | ||
destroy: ../default/destroy.yml | ||
prepare: ../default/prepare.yml | ||
converge: ../default/playbook.yml | ||
lint: | ||
name: ansible-lint | ||
|
||
scenario: | ||
name: opensuse | ||
|
||
verifier: | ||
name: testinfra | ||
lint: | ||
name: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import os | ||
|
||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') | ||
|
||
|
||
def test_visual_studio_code(Command): | ||
assert Command('which code').rc == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import pytest | ||
|
||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') | ||
|
||
|
||
@pytest.mark.parametrize('extension', [ | ||
'ms-python.python', | ||
'wholroyd.jinja' | ||
]) | ||
def test_visual_studio_code(Command, extension): | ||
output = Command.check_output('sudo --user test_usr -H code %s %s', | ||
'--install-extension', extension) | ||
assert 'already installed' in output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
|
||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') | ||
|
||
|
||
def test_settings(File): | ||
settings_file = File('/home/test_usr/.config/Code/User/settings.json') | ||
|
||
assert settings_file.exists | ||
assert settings_file.is_file | ||
assert settings_file.user == 'test_usr' | ||
assert settings_file.group == 'users' | ||
assert oct(settings_file.mode) == '0600' | ||
assert settings_file.contains('"Vagrantfile": "ruby"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- name: install key (zypper) | ||
become: yes | ||
rpm_key: | ||
state: present | ||
key: https://packages.microsoft.com/keys/microsoft.asc | ||
|
||
- name: write repo configuration (zypper) | ||
become: yes | ||
template: | ||
src: vscode.repo.j2 | ||
dest: '/etc/zypp/repos.d/vscode.repo' | ||
mode: 'u=rw,go=' | ||
owner: root | ||
group: root | ||
|
||
- name: install VS Code (zypper) | ||
become: yes | ||
zypper: | ||
name: "code{{ (visual_studio_code_version != '') | ternary('=' + visual_studio_code_version, '') }}" | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{ ansible_managed | comment }} | ||
[code] | ||
name=Visual Studio Code | ||
baseurl=https://packages.microsoft.com/yumrepos/vscode | ||
enabled=1 | ||
type=rpm-md | ||
gpgcheck=1 | ||
gpgkey=https://packages.microsoft.com/keys/microsoft.asc |