Skip to content

Commit 194bf72

Browse files
committed
Initial Commit
0 parents  commit 194bf72

File tree

11 files changed

+202
-0
lines changed

11 files changed

+202
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
vars/private.yml
3+
.kitchen.local.yml
4+
.kitchen

.kitchen.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
driver:
3+
name: docker
4+
use_sudo: false
5+
6+
provisioner:
7+
hosts: test-kitchen
8+
name: ansible_playbook
9+
require_chef_for_busser: false
10+
ansible_verbosity: 2
11+
ansible_verbose: true
12+
idempotency_test: true
13+
14+
platforms:
15+
- name: ubuntu-16.04
16+
driver_config:
17+
image: williamyeh/ansible:ubuntu16.04-onbuild
18+
platform: ubuntu
19+
20+
verifier:
21+
name: serverspec
22+
23+
suites:
24+
- name: default
25+
driver:
26+
provision_command: export LC_ALL=C
27+
verifier:
28+
default_pattern: true
29+
bundler_path: '/usr/local/bin'
30+
rspec_path: '/usr/local/bin'

Gemfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "https://rubygems.org"
2+
3+
gem 'test-kitchen', '~> 1.8.0'
4+
gem 'kitchen-docker'
5+
gem 'kitchen-ansible'
6+
gem 'net-ssh'
7+
gem 'serverspec'
8+
gem 'kitchen-verifier-serverspec'

Gemfile.lock

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
artifactory (2.8.2)
5+
diff-lcs (1.3)
6+
kitchen-ansible (0.48.5)
7+
net-ssh (>= 3)
8+
test-kitchen (~> 1.4)
9+
kitchen-docker (2.6.0)
10+
test-kitchen (>= 1.0.0)
11+
kitchen-verifier-serverspec (0.6.11)
12+
net-ssh (>= 3)
13+
test-kitchen (~> 1.4)
14+
mixlib-install (1.2.4)
15+
artifactory
16+
mixlib-shellout
17+
mixlib-versioning
18+
mixlib-shellout (2.3.2)
19+
mixlib-versioning (1.2.2)
20+
multi_json (1.13.1)
21+
net-scp (1.2.1)
22+
net-ssh (>= 2.6.5)
23+
net-ssh (3.2.0)
24+
net-telnet (0.1.1)
25+
rspec (3.7.0)
26+
rspec-core (~> 3.7.0)
27+
rspec-expectations (~> 3.7.0)
28+
rspec-mocks (~> 3.7.0)
29+
rspec-core (3.7.1)
30+
rspec-support (~> 3.7.0)
31+
rspec-expectations (3.7.0)
32+
diff-lcs (>= 1.2.0, < 2.0)
33+
rspec-support (~> 3.7.0)
34+
rspec-its (1.2.0)
35+
rspec-core (>= 3.0.0)
36+
rspec-expectations (>= 3.0.0)
37+
rspec-mocks (3.7.0)
38+
diff-lcs (>= 1.2.0, < 2.0)
39+
rspec-support (~> 3.7.0)
40+
rspec-support (3.7.1)
41+
safe_yaml (1.0.4)
42+
serverspec (2.41.3)
43+
multi_json
44+
rspec (~> 3.0)
45+
rspec-its
46+
specinfra (~> 2.72)
47+
sfl (2.3)
48+
specinfra (2.73.3)
49+
net-scp
50+
net-ssh (>= 2.7, < 5.0)
51+
net-telnet
52+
sfl
53+
test-kitchen (1.8.0)
54+
mixlib-install (~> 1.0, >= 1.0.4)
55+
mixlib-shellout (>= 1.2, < 3.0)
56+
net-scp (~> 1.1)
57+
net-ssh (>= 2.9, < 4.0)
58+
safe_yaml (~> 1.0)
59+
thor (~> 0.18)
60+
thor (0.20.0)
61+
62+
PLATFORMS
63+
ruby
64+
65+
DEPENDENCIES
66+
kitchen-ansible
67+
kitchen-docker
68+
kitchen-verifier-serverspec
69+
net-ssh
70+
serverspec
71+
test-kitchen (~> 1.8.0)
72+
73+
BUNDLED WITH
74+
1.16.2

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Role Name
2+
=========
3+
4+
A brief description of the role goes here.
5+
6+
Requirements
7+
------------
8+
9+
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
10+
11+
Role Variables
12+
--------------
13+
14+
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
15+
16+
Dependencies
17+
------------
18+
19+
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
20+
21+
Example Playbook
22+
----------------
23+
24+
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
25+
26+
- hosts: servers
27+
roles:
28+
- { role: username.rolename, x: 42 }
29+
30+
License
31+
-------
32+
33+
BSD
34+
35+
Author Information
36+
------------------
37+
38+
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

defaults/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
python_version: 3

meta/main.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
galaxy_info:
3+
author: Jason Hee
4+
description: Get Ansible to work on bare Ubuntu without Python pre-installed
5+
license: MIT
6+
min_ansible_version: 2.0
7+
8+
platforms:
9+
- name: Ubuntu
10+
versions:
11+
- bionic
12+
- xenial
13+
- trusty
14+
15+
galaxy_tags:
16+
- Ubuntu
17+
- Python
18+
- raw

tasks/main.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Install Python 3.x
3+
raw: which python3 || sudo apt-get update && sudo apt-get install -qq -y python3-minimal
4+
register: python_check
5+
changed_when: not python_check.stdout is search('/usr/bin/python3')
6+
when: python_version == 3
7+
8+
- name: Install Python 2.x
9+
raw: which python || sudo apt-get update && sudo apt-get install -qq -y python-minimal
10+
register: python_check
11+
changed_when: not python_check.stdout is search('/usr/bin/python')
12+
when: python_version == 2

test/integration/default/default.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- name: Setup
3+
hosts: all
4+
become: yes
5+
gather_facts: false
6+
roles:
7+
- { role: ansible-ubuntu-python-raw }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require_relative 'spec_helper'
2+
3+
describe package('python3') do
4+
it { should be_installed }
5+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Encoding: utf-8
2+
require 'serverspec'
3+
4+
set :backend, :exec

0 commit comments

Comments
 (0)