Skip to content

Commit

Permalink
Refactored from base_cplusplus.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaassssiiee committed Apr 14, 2019
0 parents commit dc030d2
Show file tree
Hide file tree
Showing 21 changed files with 598 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Config file for instance
ansible.cfg
.molecule/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

.DS_Store
.vagrant

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
sudo: required
language: python
services:
- docker

before_install:
- sudo apt-get -qq update

install:
- pip install tox-travis
- pip install -r requirements.txt

script:
- tox

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
49 changes: 49 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---

extends: default

rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
level: warning
require-starting-space: false
min-spaces-from-content: 2
comments-indentation: disable
document-end: disable
document-start: disable
empty-lines:
max: 2
max-start: 0
max-end: 0
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: true
check-multi-line-strings: false
key-duplicates: enable
line-length:
max: 250
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy: disable
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2019 Bas Meijer

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.

45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[![Galaxy](https://img.shields.io/badge/galaxy-dockpack.base__gcc-blue.svg?style=flat)](https://galaxy.ansible.com/dockpack/base_gcc)[![Build Status](https://api.travis-ci.org/dockpack/base_gcc.svg)](https://travis-ci.org/dockpack/base_gcc)

base_gcc is an ansible-role that installs Gnu compiler tools

Requirements
------------

RHEL-like system, or Ubuntu


Role Variables
--------------
- Corporate feature: toggles desired state
`compilers_present: present`

- Software collections offer latest versions of programming languages
`collections_enabled: true`

- approved/test release of software collections' devtoolset
`cplusplus_devtoolset: devtoolset-7`

- Change these defaults for optional packages.
`cplusplusrpms`
`cplusplusapts

Dependencies
------------

https://www.softwarecollections.org/en/docs/

Example Usage
----------------

Refer to a complete build server https://github.com/bbaassssiiee/buildserver

License
-------

MIT

Author Information
------------------

Bas Meijer
@bbaassssiiee
43 changes: 43 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

# Corporate feature: toggles desired state
compilers_present: present

# yum groupinstall @Development
development_groupinstall: true

# Software collections offer latest versions of programming languages
collections_enabled: false

# major release of software collections' devtoolset
GCCVER: 7
cplusplus_devtoolset: "devtoolset-{{ GCCVER }}"

cplusplus_dts_rpms:
- "{{ cplusplus_devtoolset }}-binutils"
- "{{ cplusplus_devtoolset }}-gcc"
- "{{ cplusplus_devtoolset }}-gcc-c++"
- "{{ cplusplus_devtoolset }}-make"

# optional rpms
cplusplusrpms:
- autoconf
- automake
- git
- gcc
- file-devel
- make
- openssl-devel
- libstdc++-docs
- ncurses-devel

# Ubuntu & Debian only basic compiler support
cplusplusapts:
- build-essential
- autoconf
- automake
- g++
- gcc
- git
- libc6-dev
- make
26 changes: 26 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

galaxy_info:
author: Bas Meijer
description: Ansible role to install GNU C/C++ Compilers
company: dockpack

license: MIT

min_ansible_version: 1.9.0

platforms:
- name: EL
versions:
- 6
- 7
galaxy_tags:
- system
- development
- buildserver
- gcc
- automake
- autoconf
- centos

dependencies: []
14 changes: 14 additions & 0 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
26 changes: 26 additions & 0 deletions molecule/default/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*******
Docker driver installation guide
*******

Requirements
============

* General molecule dependencies (see https://molecule.readthedocs.io/en/latest/installation.html)
* Docker Engine
* docker-py
* docker

Install
=======

Ansible < 2.6

.. code-block:: bash
$ sudo pip install docker-py
Ansible >= 2.6

.. code-block:: bash
$ sudo pip install docker
31 changes: 31 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
dependency:
name: galaxy
requirements_file: requirements.yml
driver:
name: docker
verifier:
name: goss
lint:
name: yamllint
platforms:
- name: base-gcc-centos7
image: centos:7
privileged: true
- name: base-gcc-centos6
image: centos:6
privileged: true
- name: base-gcc-ubuntu
image: ubuntu:xenial
privileged: true
provisioner:
name: ansible
config_options:
defaults:
remote_tmp: /tmp
playbooks:
converge: playbook.yml
lint:
name: ansible-lint
scenario:
name: default
8 changes: 8 additions & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- hosts: all
vars:
development_groupinstall: false

roles:
- role: base_gcc
collections_enabled: true
11 changes: 11 additions & 0 deletions molecule/default/tests/test_default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Molecule managed
package:
automake:
installed: true
autoconf:
installed: true
gcc:
installed: true
make:
installed: true
Loading

0 comments on commit dc030d2

Please sign in to comment.