External Roles as Submodules (#71)
* ctop entfernt * ctop als submodule * ansible entfernt * ansible als submodule * docker entfernt * docker als submodule * dortfiles gelöscht * dotfiles als submodule * pip gelößcht * pip als submodule * ytdl gelöscht * ytdl als submodule * nag-buster gelöscht * nag-buster als submodule * ansible-user gelöscht * ansible-user als submodule * ufw gelöscht * ufw als submodule * bootstrap gelöscht * bootstrap als submodule * create_users gelöscht * create_users als submodule * ansible-lint: Error 306 ausgeschaltet * nicht aktive Hosts auskommentiert * Pfad nag-buster angepasst
This commit is contained in:
parent
15d783de86
commit
cbc5cde077
198 changed files with 68 additions and 6494 deletions
|
@ -12,6 +12,7 @@ skip_list:
|
||||||
- '701'
|
- '701'
|
||||||
- '208'
|
- '208'
|
||||||
- '106'
|
- '106'
|
||||||
|
- '306'
|
||||||
use_default_rules: true
|
use_default_rules: true
|
||||||
verbosity: 0
|
verbosity: 0
|
||||||
# https://github.com/ansible/ansible-lint#false-positives-skipping-rules
|
# https://github.com/ansible/ansible-lint#false-positives-skipping-rules
|
||||||
|
|
33
.gitmodules
vendored
Normal file
33
.gitmodules
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
[submodule "roles/gantsign.ctop"]
|
||||||
|
path = roles/gantsign.ctop
|
||||||
|
url = https://github.com/gantsign/ansible_role_ctop
|
||||||
|
[submodule "roles/geerlingguy.ansible"]
|
||||||
|
path = roles/geerlingguy.ansible
|
||||||
|
url = https://github.com/geerlingguy/ansible-role-ansible
|
||||||
|
[submodule "roles/geerlingguy.docker"]
|
||||||
|
path = roles/geerlingguy.docker
|
||||||
|
url = https://github.com/geerlingguy/ansible-role-docker
|
||||||
|
[submodule "roles/geerlingguy.dotfiles"]
|
||||||
|
path = roles/geerlingguy.dotfiles
|
||||||
|
url = https://github.com/geerlingguy/dotfiles
|
||||||
|
[submodule "roles/geerlingguy.pip"]
|
||||||
|
path = roles/geerlingguy.pip
|
||||||
|
url = https://github.com/geerlingguy/ansible-role-pip
|
||||||
|
[submodule "roles/hedii.youtube-dl"]
|
||||||
|
path = roles/hedii.youtube-dl
|
||||||
|
url = https://github.com/hedii/ansible-role-youtube-dl
|
||||||
|
[submodule "roles/ironicbadger.proxmox-nag-removal"]
|
||||||
|
path = roles/ironicbadger.proxmox-nag-removal
|
||||||
|
url = https://github.com/IronicBadger/ansible-role-proxmox-nag-removal
|
||||||
|
[submodule "roles/nickjj.ansible-user"]
|
||||||
|
path = roles/nickjj.ansible-user
|
||||||
|
url = https://github.com/nickjj/ansible-user
|
||||||
|
[submodule "roles/oefenweb.ufw"]
|
||||||
|
path = roles/oefenweb.ufw
|
||||||
|
url = https://github.com/Oefenweb/ansible-ufw
|
||||||
|
[submodule "roles/robertdebock.bootstrap"]
|
||||||
|
path = roles/robertdebock.bootstrap
|
||||||
|
url = https://github.com/robertdebock/ansible-role-bootstrap
|
||||||
|
[submodule "roles/ryandaniels.create_users"]
|
||||||
|
path = roles/ryandaniels.create_users
|
||||||
|
url = https://github.com/ryandaniels/ansible-role-create-users
|
|
@ -39,34 +39,34 @@ all:
|
||||||
hosts:
|
hosts:
|
||||||
vm-test.grote.lan:
|
vm-test.grote.lan:
|
||||||
lxc-test.grote.lan:
|
lxc-test.grote.lan:
|
||||||
baseimage:
|
|
||||||
hosts:
|
|
||||||
vorlagebaseimage.grote.lan:
|
|
||||||
virt:
|
virt:
|
||||||
hosts:
|
hosts:
|
||||||
pve-staging.grote.lan:
|
pve-staging.grote.lan:
|
||||||
pve-test.grote.lan:
|
pve-test.grote.lan:
|
||||||
pve2.grote.lan:
|
pve2.grote.lan:
|
||||||
wsl:
|
# wsl:
|
||||||
hosts:
|
# hosts:
|
||||||
irantu.grote.lan:
|
# irantu.grote.lan:
|
||||||
qmk:
|
# baseimage:
|
||||||
hosts:
|
# hosts:
|
||||||
qmk.grote.lan:
|
# vorlagebaseimage.grote.lan:
|
||||||
ceph:
|
# qmk:
|
||||||
hosts:
|
# hosts:
|
||||||
ceph-1.grote.lan:
|
# qmk.grote.lan:
|
||||||
ceph-2.grote.lan:
|
# ceph:
|
||||||
ceph-3.grote.lan:
|
# hosts:
|
||||||
ceph-4.grote.lan:
|
# ceph-1.grote.lan:
|
||||||
ceph-5.grote.lan:
|
# ceph-2.grote.lan:
|
||||||
ceph-6.grote.lan:
|
# ceph-3.grote.lan:
|
||||||
ceph-7.grote.lan:
|
# ceph-4.grote.lan:
|
||||||
k8s:
|
# ceph-5.grote.lan:
|
||||||
hosts:
|
# ceph-6.grote.lan:
|
||||||
k8s-1.grote.lan:
|
# ceph-7.grote.lan:
|
||||||
k8s-2.grote.lan:
|
# k8s:
|
||||||
k8s-3.grote.lan:
|
# hosts:
|
||||||
|
# k8s-1.grote.lan:
|
||||||
|
# k8s-2.grote.lan:
|
||||||
|
# k8s-3.grote.lan:
|
||||||
|
|
||||||
|
|
||||||
production:
|
production:
|
||||||
|
|
1
roles/gantsign.ctop
Submodule
1
roles/gantsign.ctop
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 92f20ce81c42388295bd62afc0e3d04ab398e3c0
|
|
@ -1,27 +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
|
|
||||||
|
|
||||||
# YAML is fussy about indenting and charset
|
|
||||||
[*.yml]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
continuation_indent_size = unset
|
|
||||||
charset = utf-8
|
|
||||||
|
|
||||||
# Markdown is fussy about indenting
|
|
||||||
[*.md]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
# Jinja2 template files
|
|
||||||
[*.j2]
|
|
||||||
end_of_line = lf
|
|
47
roles/gantsign.ctop/.gitattributes
vendored
47
roles/gantsign.ctop/.gitattributes
vendored
|
@ -1,47 +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.
|
|
||||||
LICENSE text
|
|
||||||
.editorconfig text
|
|
||||||
.gitattributes text
|
|
||||||
.gitignore text
|
|
||||||
.yamllint text
|
|
||||||
*.cfg text
|
|
||||||
*.css text
|
|
||||||
*.htm text
|
|
||||||
*.html text
|
|
||||||
*.js text
|
|
||||||
*.json text
|
|
||||||
*.less text
|
|
||||||
*.md text
|
|
||||||
*.py text
|
|
||||||
*.scss text
|
|
||||||
*.ts text
|
|
||||||
*.txt text
|
|
||||||
*.xhtml text
|
|
||||||
*.xml text
|
|
||||||
*.yaml text
|
|
||||||
*.yml 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.
|
|
||||||
*.conf eol=lf
|
|
||||||
*.desktop eol=lf
|
|
||||||
*.j2 eol=lf
|
|
||||||
*.service eol=lf
|
|
||||||
*.sh text eol=lf
|
|
||||||
|
|
||||||
# Denote all files that are truly binary and should not be modified.
|
|
||||||
*.eot binary
|
|
||||||
*.gif binary
|
|
||||||
*.jpeg binary
|
|
||||||
*.jpg binary
|
|
||||||
*.png binary
|
|
||||||
*.tff binary
|
|
||||||
*.woff binary
|
|
297
roles/gantsign.ctop/.gitignore
vendored
297
roles/gantsign.ctop/.gitignore
vendored
|
@ -1,297 +0,0 @@
|
||||||
# Created by https://www.gitignore.io/api/windows,linux,osx,vim,emacs,intellij,eclipse,visualstudiocode,ansible
|
|
||||||
|
|
||||||
### Ansible ###
|
|
||||||
*.retry
|
|
||||||
|
|
||||||
### Eclipse ###
|
|
||||||
|
|
||||||
.metadata
|
|
||||||
bin/
|
|
||||||
tmp/
|
|
||||||
*.tmp
|
|
||||||
*.bak
|
|
||||||
*.swp
|
|
||||||
*~.nib
|
|
||||||
local.properties
|
|
||||||
.settings/
|
|
||||||
.loadpath
|
|
||||||
.recommenders
|
|
||||||
|
|
||||||
# External tool builders
|
|
||||||
.externalToolBuilders/
|
|
||||||
|
|
||||||
# Locally stored "Eclipse launch configurations"
|
|
||||||
*.launch
|
|
||||||
|
|
||||||
# PyDev specific (Python IDE for Eclipse)
|
|
||||||
*.pydevproject
|
|
||||||
|
|
||||||
# CDT-specific (C/C++ Development Tooling)
|
|
||||||
.cproject
|
|
||||||
|
|
||||||
# CDT- autotools
|
|
||||||
.autotools
|
|
||||||
|
|
||||||
# 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/
|
|
||||||
|
|
||||||
# Annotation Processing
|
|
||||||
.apt_generated/
|
|
||||||
|
|
||||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
|
||||||
.cache-main
|
|
||||||
.scala_dependencies
|
|
||||||
.worksheet
|
|
||||||
|
|
||||||
### Eclipse Patch ###
|
|
||||||
# Eclipse Core
|
|
||||||
.project
|
|
||||||
|
|
||||||
# JDT-specific (Eclipse Java Development Tools)
|
|
||||||
.classpath
|
|
||||||
|
|
||||||
# Annotation Processing
|
|
||||||
.apt_generated
|
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
||||||
# directory configuration
|
|
||||||
.dir-locals.el
|
|
||||||
|
|
||||||
### 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/**/usage.statistics.xml
|
|
||||||
.idea/**/dictionaries
|
|
||||||
.idea/**/shelf
|
|
||||||
|
|
||||||
# Sensitive or high-churn files
|
|
||||||
.idea/**/dataSources/
|
|
||||||
.idea/**/dataSources.ids
|
|
||||||
.idea/**/dataSources.local.xml
|
|
||||||
.idea/**/sqlDataSources.xml
|
|
||||||
.idea/**/dynamic.xml
|
|
||||||
.idea/**/uiDesigner.xml
|
|
||||||
.idea/**/dbnavigator.xml
|
|
||||||
|
|
||||||
# Gradle
|
|
||||||
.idea/**/gradle.xml
|
|
||||||
.idea/**/libraries
|
|
||||||
|
|
||||||
# Gradle and Maven with auto-import
|
|
||||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
|
||||||
# since they will be recreated, and may cause churn. Uncomment if using
|
|
||||||
# auto-import.
|
|
||||||
# .idea/modules.xml
|
|
||||||
# .idea/*.iml
|
|
||||||
# .idea/modules
|
|
||||||
|
|
||||||
# CMake
|
|
||||||
cmake-build-*/
|
|
||||||
|
|
||||||
# Mongo Explorer plugin
|
|
||||||
.idea/**/mongoSettings.xml
|
|
||||||
|
|
||||||
# File-based project format
|
|
||||||
*.iws
|
|
||||||
|
|
||||||
# IntelliJ
|
|
||||||
out/
|
|
||||||
|
|
||||||
# mpeltonen/sbt-idea plugin
|
|
||||||
.idea_modules/
|
|
||||||
|
|
||||||
# JIRA plugin
|
|
||||||
atlassian-ide-plugin.xml
|
|
||||||
|
|
||||||
# Cursive Clojure plugin
|
|
||||||
.idea/replstate.xml
|
|
||||||
|
|
||||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
||||||
com_crashlytics_export_strings.xml
|
|
||||||
crashlytics.properties
|
|
||||||
crashlytics-build.properties
|
|
||||||
fabric.properties
|
|
||||||
|
|
||||||
# Editor-based Rest Client
|
|
||||||
.idea/httpRequests
|
|
||||||
|
|
||||||
### Intellij Patch ###
|
|
||||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
|
||||||
|
|
||||||
# *.iml
|
|
||||||
# modules.xml
|
|
||||||
# .idea/misc.xml
|
|
||||||
# *.ipr
|
|
||||||
|
|
||||||
# Sonarlint plugin
|
|
||||||
.idea/sonarlint
|
|
||||||
|
|
||||||
### 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-*
|
|
||||||
|
|
||||||
# .nfs files are created when an open file is removed but is still being accessed
|
|
||||||
.nfs*
|
|
||||||
|
|
||||||
### OSX ###
|
|
||||||
# General
|
|
||||||
.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-v][a-z]
|
|
||||||
[._]*.sw[a-p]
|
|
||||||
[._]s[a-rt-v][a-z]
|
|
||||||
[._]ss[a-gi-z]
|
|
||||||
[._]sw[a-p]
|
|
||||||
|
|
||||||
# Session
|
|
||||||
Session.vim
|
|
||||||
|
|
||||||
# Temporary
|
|
||||||
.netrwhist
|
|
||||||
# Auto-generated tag files
|
|
||||||
tags
|
|
||||||
# Persistent undo
|
|
||||||
[._]*.un~
|
|
||||||
|
|
||||||
### VisualStudioCode ###
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
|
|
||||||
### Windows ###
|
|
||||||
# Windows thumbnail cache files
|
|
||||||
Thumbs.db
|
|
||||||
ehthumbs.db
|
|
||||||
ehthumbs_vista.db
|
|
||||||
|
|
||||||
# Dump file
|
|
||||||
*.stackdump
|
|
||||||
|
|
||||||
# Folder config file
|
|
||||||
[Dd]esktop.ini
|
|
||||||
|
|
||||||
# Recycle Bin used on file shares
|
|
||||||
$RECYCLE.BIN/
|
|
||||||
|
|
||||||
# Windows Installer files
|
|
||||||
*.cab
|
|
||||||
*.msi
|
|
||||||
*.msix
|
|
||||||
*.msm
|
|
||||||
*.msp
|
|
||||||
|
|
||||||
# Windows shortcuts
|
|
||||||
*.lnk
|
|
||||||
|
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/windows,linux,osx,vim,emacs,intellij,eclipse,visualstudiocode,ansible
|
|
||||||
|
|
||||||
####################
|
|
||||||
### Custom rules ###
|
|
||||||
####################
|
|
||||||
|
|
||||||
### Molecule ###
|
|
||||||
|
|
||||||
__pycache__
|
|
||||||
.cache
|
|
||||||
.molecule
|
|
|
@ -1 +0,0 @@
|
||||||
2.9.1
|
|
|
@ -1 +0,0 @@
|
||||||
2.22
|
|
|
@ -1 +0,0 @@
|
||||||
2.7.15
|
|
|
@ -1,77 +0,0 @@
|
||||||
---
|
|
||||||
language: python
|
|
||||||
python: '2.7'
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- MOLECULEW_USE_SYSTEM=true
|
|
||||||
|
|
||||||
# Spin off separate builds for each of the following versions
|
|
||||||
# of Ansible and Linux.
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.7.15
|
|
||||||
- MOLECULE_SCENARIO=centos
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.7.15
|
|
||||||
- MOLECULE_SCENARIO=debian_max
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.7.15
|
|
||||||
- MOLECULE_SCENARIO=debian_min
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.7.15
|
|
||||||
- MOLECULE_SCENARIO=ubuntu_max
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.7.15
|
|
||||||
- MOLECULE_SCENARIO=ubuntu_min
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.7.15
|
|
||||||
- MOLECULE_SCENARIO=opensuse
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.9.1
|
|
||||||
- MOLECULE_SCENARIO=centos
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.9.1
|
|
||||||
- MOLECULE_SCENARIO=debian_max
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.9.1
|
|
||||||
- MOLECULE_SCENARIO=debian_min
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.9.1
|
|
||||||
- MOLECULE_SCENARIO=ubuntu_max
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.9.1
|
|
||||||
- MOLECULE_SCENARIO=ubuntu_min
|
|
||||||
- env:
|
|
||||||
- MOLECULEW_ANSIBLE=2.9.1
|
|
||||||
- MOLECULE_SCENARIO=opensuse
|
|
||||||
|
|
||||||
# Require Ubuntu 16.04
|
|
||||||
dist: xenial
|
|
||||||
|
|
||||||
# Require Docker
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
install:
|
|
||||||
# Install dependencies
|
|
||||||
- ./moleculew wrapper-install
|
|
||||||
|
|
||||||
# Display versions
|
|
||||||
- ./moleculew wrapper-versions
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./moleculew test --scenario-name=$MOLECULE_SCENARIO
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/.moleculew
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([\.\-].*)?$/
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
|
@ -1,33 +0,0 @@
|
||||||
---
|
|
||||||
# Based on ansible-lint config
|
|
||||||
extends: default
|
|
||||||
|
|
||||||
rules:
|
|
||||||
braces:
|
|
||||||
max-spaces-inside: 1
|
|
||||||
level: error
|
|
||||||
brackets:
|
|
||||||
max-spaces-inside: 1
|
|
||||||
level: error
|
|
||||||
colons:
|
|
||||||
max-spaces-after: -1
|
|
||||||
level: error
|
|
||||||
commas:
|
|
||||||
max-spaces-after: -1
|
|
||||||
level: error
|
|
||||||
comments: disable
|
|
||||||
comments-indentation: disable
|
|
||||||
document-start: disable
|
|
||||||
empty-lines:
|
|
||||||
max: 3
|
|
||||||
level: error
|
|
||||||
hyphens:
|
|
||||||
level: error
|
|
||||||
indentation: disable
|
|
||||||
key-duplicates: enable
|
|
||||||
line-length: disable
|
|
||||||
new-line-at-end-of-file: disable
|
|
||||||
new-lines:
|
|
||||||
type: unix
|
|
||||||
trailing-spaces: disable
|
|
||||||
truthy: disable
|
|
|
@ -1,21 +0,0 @@
|
||||||
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.
|
|
|
@ -1,156 +0,0 @@
|
||||||
Ansible Role: ctop
|
|
||||||
==================
|
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.com/gantsign/ansible_role_ctop.svg?branch=master)](https://travis-ci.com/gantsign/ansible_role_ctop)
|
|
||||||
[![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-gantsign.ctop-blue.svg)](https://galaxy.ansible.com/gantsign/ctop)
|
|
||||||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/gantsign/ansible_role_ctop/master/LICENSE)
|
|
||||||
|
|
||||||
Role to download and install [ctop](https://ctop.sh) the top-like interface for
|
|
||||||
container metrics. View CPU, RAM and network I/O for your Docker containers at
|
|
||||||
a glance from your terminal.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
|
|
||||||
* Ansible >= 2.7
|
|
||||||
|
|
||||||
* Linux Distribution
|
|
||||||
|
|
||||||
* Debian Family
|
|
||||||
|
|
||||||
* Debian
|
|
||||||
|
|
||||||
* Jessie (8)
|
|
||||||
* Stretch (9)
|
|
||||||
|
|
||||||
* Ubuntu
|
|
||||||
|
|
||||||
* Xenial (16.04)
|
|
||||||
* Bionic (18.04)
|
|
||||||
|
|
||||||
* RedHat Family
|
|
||||||
|
|
||||||
* CentOS
|
|
||||||
|
|
||||||
* 7
|
|
||||||
|
|
||||||
* Fedora
|
|
||||||
|
|
||||||
* 31
|
|
||||||
|
|
||||||
* SUSE Family
|
|
||||||
|
|
||||||
* openSUSE
|
|
||||||
|
|
||||||
* 15.1
|
|
||||||
|
|
||||||
* Note: other versions are likely to work but have not been tested.
|
|
||||||
|
|
||||||
* Docker (already installed)
|
|
||||||
|
|
||||||
Role Variables
|
|
||||||
--------------
|
|
||||||
|
|
||||||
The following variables will change the behavior of this role (default values
|
|
||||||
are shown below):
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# ctop version number
|
|
||||||
ctop_version: '0.7.3'
|
|
||||||
|
|
||||||
# SHA256 sum for the ctop redistributable
|
|
||||||
ctop_redis_sha256sum: '54598d424396cbe25646e097b47d76a55d475c29ae4c3111548141a3ecfb7fc1'
|
|
||||||
|
|
||||||
# Directory to store files downloaded for ctop
|
|
||||||
ctop_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}"
|
|
||||||
```
|
|
||||||
|
|
||||||
Example Playbook
|
|
||||||
----------------
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- role: gantsign.ctop
|
|
||||||
```
|
|
||||||
|
|
||||||
Tab Completion for Zsh
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
### Using Ansible
|
|
||||||
|
|
||||||
We recommend using the
|
|
||||||
[gantsign.antigen](https://galaxy.ansible.com/gantsign/antigen) role to enable
|
|
||||||
tab completion for ctop (this must be configured for each user).
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- role: gantsign.ctop
|
|
||||||
|
|
||||||
- role: gantsign.antigen
|
|
||||||
users:
|
|
||||||
- username: example
|
|
||||||
antigen_bundles:
|
|
||||||
- name: ctop
|
|
||||||
url: gantsign/zsh-plugins
|
|
||||||
location: ctop
|
|
||||||
```
|
|
||||||
|
|
||||||
### Using Antigen
|
|
||||||
|
|
||||||
If you prefer to use [Antigen](https://github.com/zsh-users/antigen) directly
|
|
||||||
add the following to your Antigen configuration:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
antigen bundle gantsign/zsh-plugins ctop
|
|
||||||
```
|
|
||||||
|
|
||||||
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)
|
|
|
@ -1,9 +0,0 @@
|
||||||
---
|
|
||||||
# ctop version number
|
|
||||||
ctop_version: '0.7.3'
|
|
||||||
|
|
||||||
# SHA256 sum for the ctop redistributable
|
|
||||||
ctop_redis_sha256sum: '54598d424396cbe25646e097b47d76a55d475c29ae4c3111548141a3ecfb7fc1'
|
|
||||||
|
|
||||||
# Directory to store files downloaded for ctop
|
|
||||||
ctop_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}"
|
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
# handlers file for ansible_role_ctop
|
|
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
galaxy_info:
|
|
||||||
author: John Freeman
|
|
||||||
role_name: ctop
|
|
||||||
description: Ansible role for downloading and installing ctop.
|
|
||||||
company: GantSign Ltd.
|
|
||||||
license: MIT
|
|
||||||
min_ansible_version: 2.7
|
|
||||||
platforms:
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- 7
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- 31
|
|
||||||
- name: Ubuntu
|
|
||||||
versions:
|
|
||||||
- xenial
|
|
||||||
- bionic
|
|
||||||
- name: Debian
|
|
||||||
versions:
|
|
||||||
- jessie
|
|
||||||
- stretch
|
|
||||||
- name: opensuse
|
|
||||||
versions:
|
|
||||||
- 15.1
|
|
||||||
galaxy_tags:
|
|
||||||
- ctop
|
|
||||||
- docker
|
|
||||||
- development
|
|
||||||
dependencies: []
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_centos
|
|
||||||
image: centos:7
|
|
||||||
dockerfile: ../default/Dockerfile.j2
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ../default/playbook.yml
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: centos
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
directory: ../default/tests
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_debian_max
|
|
||||||
image: debian:9
|
|
||||||
dockerfile: ../default/Dockerfile.j2
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ../default/playbook.yml
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: debian_max
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
directory: ../default/tests
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_debian_min
|
|
||||||
image: debian:8
|
|
||||||
dockerfile: ../default/Dockerfile.j2
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ../default/playbook.yml
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: debian_min
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
directory: ../default/tests
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,22 +0,0 @@
|
||||||
# Molecule managed
|
|
||||||
|
|
||||||
{% if item.registry is defined %}
|
|
||||||
FROM {{ item.registry.url }}/{{ item.image }}
|
|
||||||
{% else %}
|
|
||||||
FROM {{ item.image }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if item.env is defined %}
|
|
||||||
{% for var, value in item.env.items() %}
|
|
||||||
{% if value %}
|
|
||||||
ENV {{ var }} {{ value }}
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \
|
|
||||||
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \
|
|
||||||
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && 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 iproute2 && 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 iproute2 && xbps-remove -O; fi
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_default
|
|
||||||
image: ubuntu:18.04
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: default
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
roles:
|
|
||||||
- role: ansible_role_ctop
|
|
|
@ -1,30 +0,0 @@
|
||||||
import os
|
|
||||||
|
|
||||||
import testinfra.utils.ansible_runner
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|
||||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
|
||||||
|
|
||||||
|
|
||||||
def test_dir(host):
|
|
||||||
dir = host.file('/usr/local/bin')
|
|
||||||
assert dir.exists
|
|
||||||
assert dir.is_directory
|
|
||||||
assert dir.user == 'root'
|
|
||||||
assert dir.group == 'root'
|
|
||||||
|
|
||||||
|
|
||||||
def test_file(host):
|
|
||||||
installed_file = host.file('/usr/local/bin/ctop')
|
|
||||||
assert installed_file.exists
|
|
||||||
assert installed_file.is_file
|
|
||||||
assert installed_file.user == 'root'
|
|
||||||
assert installed_file.group == 'root'
|
|
||||||
|
|
||||||
|
|
||||||
def test_version(host):
|
|
||||||
version = host.check_output('ctop -v')
|
|
||||||
pattern = 'ctop version [0-9\\.]+'
|
|
||||||
assert re.search(pattern, version)
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_fedora
|
|
||||||
image: fedora:31
|
|
||||||
dockerfile: ../default/Dockerfile.j2
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ../default/playbook.yml
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: fedora
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
directory: ../default/tests
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_opensuse
|
|
||||||
image: opensuse/leap:15.1
|
|
||||||
dockerfile: ../default/Dockerfile.j2
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ../default/playbook.yml
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: opensuse
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
directory: ../default/tests
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_ubuntu_max
|
|
||||||
image: ubuntu:18.04
|
|
||||||
dockerfile: ../default/Dockerfile.j2
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ../default/playbook.yml
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: ubuntu_max
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
directory: ../default/tests
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,22 +0,0 @@
|
||||||
*******
|
|
||||||
Docker driver installation guide
|
|
||||||
*******
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
============
|
|
||||||
|
|
||||||
* Docker Engine
|
|
||||||
|
|
||||||
Install
|
|
||||||
=======
|
|
||||||
|
|
||||||
Please refer to the `Virtual environment`_ documentation for installation best
|
|
||||||
practices. If not using a virtual environment, please consider passing the
|
|
||||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
|
||||||
|
|
||||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
|
||||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ pip install 'molecule[docker]'
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: ansible_role_ctop_ubuntu_min
|
|
||||||
image: ubuntu:16.04
|
|
||||||
dockerfile: ../default/Dockerfile.j2
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ../default/playbook.yml
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
|
|
||||||
scenario:
|
|
||||||
name: ubuntu_min
|
|
||||||
|
|
||||||
verifier:
|
|
||||||
name: testinfra
|
|
||||||
directory: ../default/tests
|
|
||||||
lint:
|
|
||||||
name: flake8
|
|
|
@ -1,736 +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.12
|
|
||||||
|
|
||||||
VERSION_DIR='.moleculew'
|
|
||||||
PYTHON_VERSION_FILE="$VERSION_DIR/python_version"
|
|
||||||
ANSIBLE_VERSION_FILE="$VERSION_DIR/ansible_version"
|
|
||||||
MOLECULE_VERSION_FILE="$VERSION_DIR/molecule_version"
|
|
||||||
|
|
||||||
BUILD_DEPENDENCIES_INSTALLLED=false
|
|
||||||
PYENV_INSTALLED=false
|
|
||||||
|
|
||||||
ANSIBLE_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 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 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 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
|
|
||||||
PYTHON_EXE="$(command -v 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_molecule() {
|
|
||||||
banner "Installing Molecule $MOLECULE_VERSION into virtualenv $VIRTUAL_ENV"
|
|
||||||
|
|
||||||
# Workaround https://github.com/ansible-community/molecule/issues/2676
|
|
||||||
pip install 'sh==1.12.14'
|
|
||||||
|
|
||||||
pip install "molecule[docker]==$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 "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 "$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 "$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_MOLECULE_VERSION="$MOLECULE_VERSION"
|
|
||||||
|
|
||||||
query_latest_python_version2
|
|
||||||
query_latest_package_version ANSIBLE_VERSION ansible
|
|
||||||
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_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
|
|
||||||
--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.7'
|
|
||||||
}
|
|
||||||
|
|
||||||
wrapper_options_molecule() {
|
|
||||||
echo 'latest'
|
|
||||||
query_package_versions 'molecule' '2.20'
|
|
||||||
}
|
|
||||||
|
|
||||||
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.safe_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
|
|
||||||
;;
|
|
||||||
--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 [[ $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 [[ $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"
|
|
||||||
|
|
||||||
if [ ! -f "$MOLECULE_WRAPPER_ENV/bin/activate" ]; 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_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-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
|
|
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
- name: create download directory
|
|
||||||
file:
|
|
||||||
state: directory
|
|
||||||
mode: 'u=rwx,go=rx'
|
|
||||||
dest: '{{ ctop_download_dir }}'
|
|
||||||
|
|
||||||
- name: download ctop
|
|
||||||
get_url:
|
|
||||||
url: '{{ ctop_mirror }}/{{ ctop_redis_filename }}'
|
|
||||||
dest: '{{ ctop_download_dir }}/{{ ctop_redis_filename }}'
|
|
||||||
checksum: 'sha256:{{ ctop_redis_sha256sum }}'
|
|
||||||
mode: 'u=rw,go=r'
|
|
||||||
|
|
||||||
- name: create the ctop installation dir
|
|
||||||
become: yes
|
|
||||||
file:
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 'u=rwx,go=rx'
|
|
||||||
dest: '{{ ctop_install_dir }}'
|
|
||||||
|
|
||||||
- name: install ctop
|
|
||||||
become: yes
|
|
||||||
copy:
|
|
||||||
src: '{{ ctop_download_dir }}/{{ ctop_redis_filename }}'
|
|
||||||
remote_src: yes
|
|
||||||
dest: '{{ ctop_install_path }}'
|
|
||||||
force: yes
|
|
||||||
mode: 'u=rwx,go=rx'
|
|
|
@ -1,18 +0,0 @@
|
||||||
---
|
|
||||||
# Dir where ctop should be installed
|
|
||||||
ctop_install_dir: '/usr/local/bin'
|
|
||||||
|
|
||||||
# Path where ctop should be installed
|
|
||||||
ctop_install_path: '{{ ctop_install_dir }}/ctop'
|
|
||||||
|
|
||||||
# Mirror to download the ctop from
|
|
||||||
ctop_mirror: 'https://github.com/bcicen/ctop/releases/download/v{{ ctop_version }}'
|
|
||||||
|
|
||||||
# The OS of the ctop redistributable
|
|
||||||
ctop_os: 'linux'
|
|
||||||
|
|
||||||
# The CPU architecture of the ctop redistributable
|
|
||||||
ctop_architecture: 'amd64'
|
|
||||||
|
|
||||||
# File name of the ctop redistributable file
|
|
||||||
ctop_redis_filename: 'ctop-{{ ctop_version }}-{{ ctop_os }}-{{ ctop_architecture }}'
|
|
1
roles/geerlingguy.ansible
Submodule
1
roles/geerlingguy.ansible
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit adf22d8c735670a8323f118de6bc37ba6b67f86e
|
|
@ -1,2 +0,0 @@
|
||||||
skip_list:
|
|
||||||
- '106'
|
|
|
@ -1,4 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
---
|
|
||||||
github: geerlingguy
|
|
||||||
patreon: geerlingguy
|
|
56
roles/geerlingguy.ansible/.github/stale.yml
vendored
56
roles/geerlingguy.ansible/.github/stale.yml
vendored
|
@ -1,56 +0,0 @@
|
||||||
# Configuration for probot-stale - https://github.com/probot/stale
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
|
||||||
daysUntilStale: 90
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
|
||||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
|
||||||
daysUntilClose: 30
|
|
||||||
|
|
||||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
|
|
||||||
onlyLabels: []
|
|
||||||
|
|
||||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
|
||||||
exemptLabels:
|
|
||||||
- pinned
|
|
||||||
- security
|
|
||||||
- planned
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a project (defaults to false)
|
|
||||||
exemptProjects: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a milestone (defaults to false)
|
|
||||||
exemptMilestones: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues with an assignee (defaults to false)
|
|
||||||
exemptAssignees: false
|
|
||||||
|
|
||||||
# Label to use when marking as stale
|
|
||||||
staleLabel: stale
|
|
||||||
|
|
||||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
|
||||||
limitPerRun: 30
|
|
||||||
|
|
||||||
pulls:
|
|
||||||
markComment: |-
|
|
||||||
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This pull request is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
|
|
||||||
|
|
||||||
issues:
|
|
||||||
markComment: |-
|
|
||||||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This issue is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
|
|
3
roles/geerlingguy.ansible/.gitignore
vendored
3
roles/geerlingguy.ansible/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
*.retry
|
|
||||||
*/__pycache__
|
|
||||||
*.pyc
|
|
|
@ -1,38 +0,0 @@
|
||||||
---
|
|
||||||
language: python
|
|
||||||
services: docker
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- ROLE_NAME: ansible
|
|
||||||
matrix:
|
|
||||||
- MOLECULE_DISTRO: centos8
|
|
||||||
- MOLECULE_DISTRO: fedora32
|
|
||||||
# See: https://github.com/geerlingguy/ansible-role-ansible/issues/18
|
|
||||||
# - MOLECULE_DISTRO: ubuntu2004
|
|
||||||
- MOLECULE_DISTRO: ubuntu1804
|
|
||||||
- MOLECULE_DISTRO: debian10
|
|
||||||
|
|
||||||
- MOLECULE_DISTRO: centos8
|
|
||||||
MOLECULE_PLAYBOOK: playbook-pip.yml
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
# Upgrade Docker to work with docker-py.
|
|
||||||
- curl https://gist.githubusercontent.com/geerlingguy/ce883ad4aec6a5f1187ef93bd338511e/raw/36612d28981d92863f839c5aefe5b7dd7193d6c6/travis-ci-docker-upgrade.sh | sudo bash
|
|
||||||
|
|
||||||
install:
|
|
||||||
# Install test dependencies.
|
|
||||||
- pip install molecule yamllint ansible-lint docker
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
# Use actual Ansible Galaxy role name for the project directory.
|
|
||||||
- cd ../
|
|
||||||
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
|
|
||||||
- cd geerlingguy.$ROLE_NAME
|
|
||||||
|
|
||||||
script:
|
|
||||||
# Run tests.
|
|
||||||
- molecule test
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
extends: default
|
|
||||||
|
|
||||||
rules:
|
|
||||||
line-length:
|
|
||||||
max: 120
|
|
||||||
level: warning
|
|
||||||
|
|
||||||
ignore: |
|
|
||||||
.github/stale.yml
|
|
|
@ -1,20 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2017 Jeff Geerling
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,51 +0,0 @@
|
||||||
# Ansible Role: Ansible
|
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-ansible.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-ansible)
|
|
||||||
|
|
||||||
An Ansible Role that installs Ansible on Linux servers.
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
If using on a RedHat/CentOS-based host, make sure you've added the EPEL repository (it can easily be installed by including the `geerlingguy.repo-epel` role on Ansible Galaxy).
|
|
||||||
|
|
||||||
## Role Variables
|
|
||||||
|
|
||||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
|
||||||
|
|
||||||
ansible_install_method: package
|
|
||||||
|
|
||||||
Whether to install Ansible via the system `package` manager (`apt`, `yum`, `dnf`, etc.), or via `pip`. If set to `pip`, you need to make sure Pip is installed prior to running this role. You can use the `geerlingguy.pip` module to install Pip easily.
|
|
||||||
|
|
||||||
ansible_install_version_pip: ''
|
|
||||||
|
|
||||||
If `ansible_install_method` is set to `pip`, the specific Ansible version to be installed via Pip. If not set, the latest version of Ansible will be installed.
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
## Example Playbook
|
|
||||||
|
|
||||||
Install from the system package manager:
|
|
||||||
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- role: geerlingguy.ansible
|
|
||||||
|
|
||||||
Install from pip:
|
|
||||||
|
|
||||||
- hosts: servers
|
|
||||||
vars:
|
|
||||||
ansible_install_method: pip
|
|
||||||
ansible_install_version_pip: "2.7.0"
|
|
||||||
roles:
|
|
||||||
- role: geerlingguy.pip
|
|
||||||
- role: geerlingguy.ansible
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT / BSD
|
|
||||||
|
|
||||||
## Author Information
|
|
||||||
|
|
||||||
This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
|
|
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
ansible_default_release: ""
|
|
||||||
|
|
||||||
# Valid options include: 'package' or 'pip'.
|
|
||||||
ansible_install_method: package
|
|
||||||
|
|
||||||
# Used only if ansible_install_method is 'pip'. If empty, defaults to latest.
|
|
||||||
ansible_install_version_pip: ''
|
|
|
@ -1,29 +0,0 @@
|
||||||
---
|
|
||||||
dependencies: []
|
|
||||||
|
|
||||||
galaxy_info:
|
|
||||||
author: geerlingguy
|
|
||||||
description: Ansible for RedHat/CentOS/Debian/Ubuntu.
|
|
||||||
company: "Midwestern Mac, LLC"
|
|
||||||
license: "license (BSD, MIT)"
|
|
||||||
min_ansible_version: 2.4
|
|
||||||
platforms:
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
- name: Debian
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
- name: Ubuntu
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
galaxy_tags:
|
|
||||||
- system
|
|
||||||
- packaging
|
|
||||||
- development
|
|
||||||
- cloud
|
|
||||||
- ansible
|
|
||||||
- automation
|
|
|
@ -1,12 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
|
|
||||||
pre_tasks:
|
|
||||||
- name: Update apt cache.
|
|
||||||
apt: update_cache=true cache_valid_time=300
|
|
||||||
when: ansible_os_family == 'Debian'
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- role: geerlingguy.ansible
|
|
|
@ -1,21 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
lint: |
|
|
||||||
set -e
|
|
||||||
yamllint .
|
|
||||||
ansible-lint
|
|
||||||
platforms:
|
|
||||||
- name: instance
|
|
||||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
|
||||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
privileged: true
|
|
||||||
pre_build_image: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
|
|
@ -1,12 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
|
|
||||||
vars:
|
|
||||||
ansible_install_method: pip
|
|
||||||
ansible_install_version_pip: "2.6.2"
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- role: geerlingguy.pip
|
|
||||||
- role: geerlingguy.ansible
|
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
- role: geerlingguy.pip
|
|
|
@ -1,34 +0,0 @@
|
||||||
---
|
|
||||||
- name: Set the package state based on how Ansible is installed.
|
|
||||||
set_fact:
|
|
||||||
ansible_package_state: "{{ 'present' if ansible_install_method == 'package' else 'absent' }}"
|
|
||||||
|
|
||||||
# Setup/install tasks.
|
|
||||||
- name: Set up Ansible on RedHat.
|
|
||||||
include_tasks: setup-RedHat.yml
|
|
||||||
when:
|
|
||||||
- ansible_os_family == 'RedHat'
|
|
||||||
- ansible_distribution != 'Fedora'
|
|
||||||
- ansible_install_method == 'package'
|
|
||||||
|
|
||||||
- name: Set up Ansible on Fedora.
|
|
||||||
include_tasks: setup-Fedora.yml
|
|
||||||
when:
|
|
||||||
- ansible_distribution == 'Fedora'
|
|
||||||
- ansible_install_method == 'package'
|
|
||||||
|
|
||||||
- name: Set up Ansible on Ubuntu.
|
|
||||||
include_tasks: setup-Ubuntu.yml
|
|
||||||
when:
|
|
||||||
- ansible_distribution == 'Ubuntu'
|
|
||||||
- ansible_install_method == 'package'
|
|
||||||
|
|
||||||
- name: Set up Ansible on Debian.
|
|
||||||
include_tasks: setup-Debian.yml
|
|
||||||
when:
|
|
||||||
- ansible_distribution == 'Debian'
|
|
||||||
- ansible_install_method == 'package'
|
|
||||||
|
|
||||||
- name: Set up Ansible using Pip.
|
|
||||||
include_tasks: setup-pip.yml
|
|
||||||
when: ansible_install_method == 'pip'
|
|
|
@ -1,21 +0,0 @@
|
||||||
---
|
|
||||||
- name: Enable Backports repository.
|
|
||||||
apt_repository:
|
|
||||||
repo: >-
|
|
||||||
deb http://ftp.debian.org/debian
|
|
||||||
{{ ansible_distribution_release }}-backports main'
|
|
||||||
state: present
|
|
||||||
filename: "{{ ansible_distribution_release }}_backports"
|
|
||||||
update_cache: true
|
|
||||||
when: ansible_distribution_version | int < 9
|
|
||||||
|
|
||||||
- name: Set the default_release option for older Debian versions.
|
|
||||||
set_fact:
|
|
||||||
ansible_default_release: "{{ ansible_distribution_release }}-backports"
|
|
||||||
when: ansible_distribution_version | int < 9
|
|
||||||
|
|
||||||
- name: Install Ansible.
|
|
||||||
apt:
|
|
||||||
name: ansible
|
|
||||||
state: "{{ ansible_package_state }}"
|
|
||||||
default_release: "{{ ansible_default_release }}"
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
- name: Install Ansible.
|
|
||||||
package:
|
|
||||||
name: ansible
|
|
||||||
state: "{{ ansible_package_state }}"
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
- name: Install Ansible.
|
|
||||||
package:
|
|
||||||
name: ansible
|
|
||||||
state: "{{ ansible_package_state }}"
|
|
||||||
enablerepo: epel
|
|
|
@ -1,15 +0,0 @@
|
||||||
---
|
|
||||||
- name: Ensure dirmngr is installed (gnupg dependency).
|
|
||||||
apt:
|
|
||||||
name: dirmngr
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Add ansible repository.
|
|
||||||
apt_repository:
|
|
||||||
repo: 'ppa:ansible/ansible'
|
|
||||||
update_cache: true
|
|
||||||
|
|
||||||
- name: Install Ansible.
|
|
||||||
apt:
|
|
||||||
name: ansible
|
|
||||||
state: "{{ ansible_package_state }}"
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
- name: Install Ansible via Pip.
|
|
||||||
pip:
|
|
||||||
name: ansible
|
|
||||||
version: "{{ ansible_install_version_pip | default(omit) }}"
|
|
1
roles/geerlingguy.docker
Submodule
1
roles/geerlingguy.docker
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e5adc9a5289c02cc1c7044460deb1ab59a5971f9
|
|
@ -1,2 +0,0 @@
|
||||||
skip_list:
|
|
||||||
- '306'
|
|
4
roles/geerlingguy.docker/.github/FUNDING.yml
vendored
4
roles/geerlingguy.docker/.github/FUNDING.yml
vendored
|
@ -1,4 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
---
|
|
||||||
github: geerlingguy
|
|
||||||
patreon: geerlingguy
|
|
56
roles/geerlingguy.docker/.github/stale.yml
vendored
56
roles/geerlingguy.docker/.github/stale.yml
vendored
|
@ -1,56 +0,0 @@
|
||||||
# Configuration for probot-stale - https://github.com/probot/stale
|
|
||||||
---
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
|
||||||
daysUntilStale: 90
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
|
||||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
|
||||||
daysUntilClose: 30
|
|
||||||
|
|
||||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
|
|
||||||
onlyLabels: []
|
|
||||||
|
|
||||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
|
||||||
exemptLabels:
|
|
||||||
- pinned
|
|
||||||
- security
|
|
||||||
- planned
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a project (defaults to false)
|
|
||||||
exemptProjects: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a milestone (defaults to false)
|
|
||||||
exemptMilestones: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues with an assignee (defaults to false)
|
|
||||||
exemptAssignees: false
|
|
||||||
|
|
||||||
# Label to use when marking as stale
|
|
||||||
staleLabel: stale
|
|
||||||
|
|
||||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
|
||||||
limitPerRun: 30
|
|
||||||
|
|
||||||
pulls:
|
|
||||||
markComment: |-
|
|
||||||
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This pull request is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
|
|
||||||
|
|
||||||
issues:
|
|
||||||
markComment: |-
|
|
||||||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This issue is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
|
|
3
roles/geerlingguy.docker/.gitignore
vendored
3
roles/geerlingguy.docker/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
*.retry
|
|
||||||
*/__pycache__
|
|
||||||
*.pyc
|
|
|
@ -1,33 +0,0 @@
|
||||||
---
|
|
||||||
language: python
|
|
||||||
services: docker
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- ROLE_NAME: docker
|
|
||||||
matrix:
|
|
||||||
- MOLECULE_DISTRO: centos8
|
|
||||||
- MOLECULE_DISTRO: centos7
|
|
||||||
- MOLECULE_DISTRO: ubuntu2004
|
|
||||||
- MOLECULE_DISTRO: ubuntu1804
|
|
||||||
- MOLECULE_DISTRO: ubuntu1604
|
|
||||||
- MOLECULE_DISTRO: debian10
|
|
||||||
- MOLECULE_DISTRO: debian9
|
|
||||||
- MOLECULE_DISTRO: fedora31
|
|
||||||
|
|
||||||
install:
|
|
||||||
# Install test dependencies.
|
|
||||||
- pip install molecule yamllint ansible-lint docker
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
# Use actual Ansible Galaxy role name for the project directory.
|
|
||||||
- cd ../
|
|
||||||
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
|
|
||||||
- cd geerlingguy.$ROLE_NAME
|
|
||||||
|
|
||||||
script:
|
|
||||||
# Run tests.
|
|
||||||
- molecule test
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
extends: default
|
|
||||||
rules:
|
|
||||||
line-length:
|
|
||||||
max: 200
|
|
||||||
level: warning
|
|
|
@ -1,20 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2017 Jeff Geerling
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,97 +0,0 @@
|
||||||
# Ansible Role: Docker
|
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-docker.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-docker)
|
|
||||||
|
|
||||||
An Ansible Role that installs [Docker](https://www.docker.com) on Linux.
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
## Role Variables
|
|
||||||
|
|
||||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
|
||||||
|
|
||||||
# Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
|
|
||||||
docker_edition: 'ce'
|
|
||||||
docker_package: "docker-{{ docker_edition }}"
|
|
||||||
docker_package_state: present
|
|
||||||
|
|
||||||
The `docker_edition` should be either `ce` (Community Edition) or `ee` (Enterprise Edition). You can also specify a specific version of Docker to install using the distribution-specific format: Red Hat/CentOS: `docker-{{ docker_edition }}-<VERSION>`; Debian/Ubuntu: `docker-{{ docker_edition }}=<VERSION>`.
|
|
||||||
|
|
||||||
You can control whether the package is installed, uninstalled, or at the latest version by setting `docker_package_state` to `present`, `absent`, or `latest`, respectively. Note that the Docker daemon will be automatically restarted if the Docker package is updated. This is a side effect of flushing all handlers (running any of the handlers that have been notified by this and any other role up to this point in the play).
|
|
||||||
|
|
||||||
docker_service_state: started
|
|
||||||
docker_service_enabled: true
|
|
||||||
docker_restart_handler_state: restarted
|
|
||||||
|
|
||||||
Variables to control the state of the `docker` service, and whether it should start on boot. If you're installing Docker inside a Docker container without systemd or sysvinit, you should set these to `stopped` and set the enabled variable to `no`.
|
|
||||||
|
|
||||||
docker_install_compose: true
|
|
||||||
docker_compose_version: "1.26.0"
|
|
||||||
docker_compose_path: /usr/local/bin/docker-compose
|
|
||||||
|
|
||||||
Docker Compose installation options.
|
|
||||||
|
|
||||||
docker_apt_release_channel: stable
|
|
||||||
docker_apt_arch: amd64
|
|
||||||
docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
|
|
||||||
docker_apt_ignore_key_error: True
|
|
||||||
docker_apt_gpg_key: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg
|
|
||||||
|
|
||||||
(Used only for Debian/Ubuntu.) You can switch the channel to `edge` if you want to use the Edge release.
|
|
||||||
|
|
||||||
You can change `docker_apt_gpg_key` to a different url if you are behind a firewall or provide a trustworthy mirror.
|
|
||||||
Usually in combination with changing `docker_apt_repository` as well.
|
|
||||||
|
|
||||||
docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo
|
|
||||||
docker_yum_repo_enable_edge: '0'
|
|
||||||
docker_yum_repo_enable_test: '0'
|
|
||||||
docker_yum_gpg_key: https://download.docker.com/linux/centos/gpg
|
|
||||||
|
|
||||||
(Used only for RedHat/CentOS.) You can enable the Edge or Test repo by setting the respective vars to `1`.
|
|
||||||
|
|
||||||
You can change `docker_yum_gpg_key` to a different url if you are behind a firewall or provide a trustworthy mirror.
|
|
||||||
Usually in combination with changing `docker_yum_repository` as well.
|
|
||||||
|
|
||||||
docker_users:
|
|
||||||
- user1
|
|
||||||
- user2
|
|
||||||
|
|
||||||
A list of system users to be added to the `docker` group (so they can use Docker on the server).
|
|
||||||
|
|
||||||
## Use with Ansible (and `docker` Python library)
|
|
||||||
|
|
||||||
Many users of this role wish to also use Ansible to then _build_ Docker images and manage Docker containers on the server where Docker is installed. In this case, you can easily add in the `docker` Python library using the `geerlingguy.pip` role:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- hosts: all
|
|
||||||
|
|
||||||
vars:
|
|
||||||
pip_install_packages:
|
|
||||||
- name: docker
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- geerlingguy.pip
|
|
||||||
- geerlingguy.docker
|
|
||||||
```
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
## Example Playbook
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- hosts: all
|
|
||||||
roles:
|
|
||||||
- geerlingguy.docker
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT / BSD
|
|
||||||
|
|
||||||
## Author Information
|
|
||||||
|
|
||||||
This role was created in 2017 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
|
|
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
# Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
|
|
||||||
docker_edition: 'ce'
|
|
||||||
docker_package: "docker-{{ docker_edition }}"
|
|
||||||
docker_package_state: present
|
|
||||||
|
|
||||||
# Service options.
|
|
||||||
docker_service_state: started
|
|
||||||
docker_service_enabled: true
|
|
||||||
docker_restart_handler_state: restarted
|
|
||||||
|
|
||||||
# Docker Compose options.
|
|
||||||
docker_install_compose: true
|
|
||||||
docker_compose_version: "1.26.0"
|
|
||||||
docker_compose_path: /usr/local/bin/docker-compose
|
|
||||||
|
|
||||||
# Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed.
|
|
||||||
docker_apt_release_channel: stable
|
|
||||||
docker_apt_arch: amd64
|
|
||||||
docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
|
|
||||||
docker_apt_ignore_key_error: true
|
|
||||||
docker_apt_gpg_key: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg
|
|
||||||
|
|
||||||
# Used only for RedHat/CentOS/Fedora.
|
|
||||||
docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora") | ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo
|
|
||||||
docker_yum_repo_enable_edge: '0'
|
|
||||||
docker_yum_repo_enable_test: '0'
|
|
||||||
docker_yum_gpg_key: https://download.docker.com/linux/centos/gpg
|
|
||||||
|
|
||||||
# A list of users who will be added to the docker group.
|
|
||||||
docker_users: []
|
|
|
@ -1,3 +0,0 @@
|
||||||
---
|
|
||||||
- name: restart docker
|
|
||||||
service: "name=docker state={{ docker_restart_handler_state }}"
|
|
|
@ -1,35 +0,0 @@
|
||||||
---
|
|
||||||
dependencies: []
|
|
||||||
|
|
||||||
galaxy_info:
|
|
||||||
role_name: docker
|
|
||||||
author: geerlingguy
|
|
||||||
description: Docker for Linux.
|
|
||||||
company: "Midwestern Mac, LLC"
|
|
||||||
license: "license (BSD, MIT)"
|
|
||||||
min_ansible_version: 2.4
|
|
||||||
platforms:
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- 7
|
|
||||||
- 8
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
- name: Debian
|
|
||||||
versions:
|
|
||||||
- stretch
|
|
||||||
- buster
|
|
||||||
- name: Ubuntu
|
|
||||||
versions:
|
|
||||||
- xenial
|
|
||||||
- bionic
|
|
||||||
- focal
|
|
||||||
galaxy_tags:
|
|
||||||
- web
|
|
||||||
- system
|
|
||||||
- containers
|
|
||||||
- docker
|
|
||||||
- orchestration
|
|
||||||
- compose
|
|
||||||
- server
|
|
|
@ -1,24 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
|
|
||||||
pre_tasks:
|
|
||||||
- name: Update apt cache.
|
|
||||||
apt: update_cache=yes cache_valid_time=600
|
|
||||||
when: ansible_os_family == 'Debian'
|
|
||||||
|
|
||||||
- name: Wait for systemd to complete initialization. # noqa 303
|
|
||||||
command: systemctl is-system-running
|
|
||||||
register: systemctl_status
|
|
||||||
until: >
|
|
||||||
'running' in systemctl_status.stdout or
|
|
||||||
'degraded' in systemctl_status.stdout
|
|
||||||
retries: 30
|
|
||||||
delay: 5
|
|
||||||
when: ansible_service_mgr == 'systemd'
|
|
||||||
changed_when: false
|
|
||||||
failed_when: systemctl_status.rc > 1
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- role: geerlingguy.docker
|
|
|
@ -1,21 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
lint: |
|
|
||||||
set -e
|
|
||||||
yamllint .
|
|
||||||
ansible-lint
|
|
||||||
platforms:
|
|
||||||
- name: instance
|
|
||||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
|
||||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
privileged: true
|
|
||||||
pre_build_image: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
|
|
@ -1,20 +0,0 @@
|
||||||
---
|
|
||||||
- name: Check current docker-compose version.
|
|
||||||
command: docker-compose --version
|
|
||||||
register: docker_compose_current_version
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
|
|
||||||
- name: Delete existing docker-compose version if it's different.
|
|
||||||
file:
|
|
||||||
path: "{{ docker_compose_path }}"
|
|
||||||
state: absent
|
|
||||||
when: >
|
|
||||||
docker_compose_current_version.stdout is defined
|
|
||||||
and docker_compose_version not in docker_compose_current_version.stdout
|
|
||||||
|
|
||||||
- name: Install Docker Compose (if configured).
|
|
||||||
get_url:
|
|
||||||
url: https://github.com/docker/compose/releases/download/{{ docker_compose_version }}/docker-compose-Linux-x86_64
|
|
||||||
dest: "{{ docker_compose_path }}"
|
|
||||||
mode: 0755
|
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
- name: Ensure docker users are added to the docker group.
|
|
||||||
user:
|
|
||||||
name: "{{ item }}"
|
|
||||||
groups: docker
|
|
||||||
append: true
|
|
||||||
with_items: "{{ docker_users }}"
|
|
|
@ -1,27 +0,0 @@
|
||||||
---
|
|
||||||
- include_tasks: setup-RedHat.yml
|
|
||||||
when: ansible_os_family == 'RedHat'
|
|
||||||
|
|
||||||
- include_tasks: setup-Debian.yml
|
|
||||||
when: ansible_os_family == 'Debian'
|
|
||||||
|
|
||||||
- name: Install Docker.
|
|
||||||
package:
|
|
||||||
name: "{{ docker_package }}"
|
|
||||||
state: "{{ docker_package_state }}"
|
|
||||||
notify: restart docker
|
|
||||||
|
|
||||||
- name: Ensure Docker is started and enabled at boot.
|
|
||||||
service:
|
|
||||||
name: docker
|
|
||||||
state: "{{ docker_service_state }}"
|
|
||||||
enabled: "{{ docker_service_enabled }}"
|
|
||||||
|
|
||||||
- name: Ensure handlers are notified now to avoid firewall conflicts.
|
|
||||||
meta: flush_handlers
|
|
||||||
|
|
||||||
- include_tasks: docker-compose.yml
|
|
||||||
when: docker_install_compose | bool
|
|
||||||
|
|
||||||
- include_tasks: docker-users.yml
|
|
||||||
when: docker_users | length > 0
|
|
|
@ -1,40 +0,0 @@
|
||||||
---
|
|
||||||
- name: Ensure old versions of Docker are not installed.
|
|
||||||
package:
|
|
||||||
name:
|
|
||||||
- docker
|
|
||||||
- docker-engine
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Ensure dependencies are installed.
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- apt-transport-https
|
|
||||||
- ca-certificates
|
|
||||||
- gnupg2
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Add Docker apt key.
|
|
||||||
apt_key:
|
|
||||||
url: "{{ docker_apt_gpg_key }}"
|
|
||||||
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
|
||||||
state: present
|
|
||||||
register: add_repository_key
|
|
||||||
ignore_errors: "{{ docker_apt_ignore_key_error }}"
|
|
||||||
|
|
||||||
- name: Ensure curl is present (on older systems without SNI).
|
|
||||||
package: name=curl state=present
|
|
||||||
when: add_repository_key is failed
|
|
||||||
|
|
||||||
- name: Add Docker apt key (alternative for older systems without SNI).
|
|
||||||
shell: > # noqa 306 306
|
|
||||||
curl -sSL {{ docker_apt_gpg_key }} | sudo apt-key add -
|
|
||||||
args:
|
|
||||||
warn: false
|
|
||||||
when: add_repository_key is failed
|
|
||||||
|
|
||||||
- name: Add Docker repository.
|
|
||||||
apt_repository:
|
|
||||||
repo: "{{ docker_apt_repository }}"
|
|
||||||
state: present
|
|
||||||
update_cache: true
|
|
|
@ -1,41 +0,0 @@
|
||||||
---
|
|
||||||
- name: Ensure old versions of Docker are not installed.
|
|
||||||
package:
|
|
||||||
name:
|
|
||||||
- docker
|
|
||||||
- docker-common
|
|
||||||
- docker-engine
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Add Docker GPG key.
|
|
||||||
rpm_key:
|
|
||||||
key: "{{ docker_yum_gpg_key }}"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Add Docker repository.
|
|
||||||
get_url:
|
|
||||||
url: "{{ docker_yum_repo_url }}"
|
|
||||||
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
|
|
||||||
- name: Configure Docker Edge repo.
|
|
||||||
ini_file:
|
|
||||||
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
|
||||||
section: 'docker-{{ docker_edition }}-edge'
|
|
||||||
option: enabled
|
|
||||||
value: '{{ docker_yum_repo_enable_edge }}'
|
|
||||||
|
|
||||||
- name: Configure Docker Test repo.
|
|
||||||
ini_file:
|
|
||||||
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
|
||||||
section: 'docker-{{ docker_edition }}-test'
|
|
||||||
option: enabled
|
|
||||||
value: '{{ docker_yum_repo_enable_test }}'
|
|
||||||
|
|
||||||
- name: Install containerd separately (CentOS 8).
|
|
||||||
package:
|
|
||||||
name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm
|
|
||||||
state: present
|
|
||||||
when: ansible_distribution_major_version | int == 8
|
|
1
roles/geerlingguy.dotfiles
Submodule
1
roles/geerlingguy.dotfiles
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 82dbdbc7a6462ee11f910758aab69943c54ebedb
|
|
@ -1,2 +0,0 @@
|
||||||
skip_list:
|
|
||||||
- '106'
|
|
|
@ -1,4 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
---
|
|
||||||
github: geerlingguy
|
|
||||||
patreon: geerlingguy
|
|
56
roles/geerlingguy.dotfiles/.github/stale.yml
vendored
56
roles/geerlingguy.dotfiles/.github/stale.yml
vendored
|
@ -1,56 +0,0 @@
|
||||||
# Configuration for probot-stale - https://github.com/probot/stale
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
|
||||||
daysUntilStale: 90
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
|
||||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
|
||||||
daysUntilClose: 30
|
|
||||||
|
|
||||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
|
|
||||||
onlyLabels: []
|
|
||||||
|
|
||||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
|
||||||
exemptLabels:
|
|
||||||
- pinned
|
|
||||||
- security
|
|
||||||
- planned
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a project (defaults to false)
|
|
||||||
exemptProjects: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a milestone (defaults to false)
|
|
||||||
exemptMilestones: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues with an assignee (defaults to false)
|
|
||||||
exemptAssignees: false
|
|
||||||
|
|
||||||
# Label to use when marking as stale
|
|
||||||
staleLabel: stale
|
|
||||||
|
|
||||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
|
||||||
limitPerRun: 30
|
|
||||||
|
|
||||||
pulls:
|
|
||||||
markComment: |-
|
|
||||||
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This pull request is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
|
|
||||||
|
|
||||||
issues:
|
|
||||||
markComment: |-
|
|
||||||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This issue is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
|
|
|
@ -1,67 +0,0 @@
|
||||||
---
|
|
||||||
name: CI
|
|
||||||
'on':
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
schedule:
|
|
||||||
- cron: "0 5 * * 1"
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: 'geerlingguy.dotfiles'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: Lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out the codebase.
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
path: 'geerlingguy.dotfiles'
|
|
||||||
|
|
||||||
- name: Set up Python 3.
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: Install test dependencies.
|
|
||||||
run: pip3 install yamllint ansible-lint
|
|
||||||
|
|
||||||
- name: Lint code.
|
|
||||||
run: |
|
|
||||||
yamllint .
|
|
||||||
ansible-lint
|
|
||||||
|
|
||||||
molecule:
|
|
||||||
name: Molecule
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
distro:
|
|
||||||
- centos7
|
|
||||||
- ubuntu1804
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check out the codebase.
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
path: 'geerlingguy.dotfiles'
|
|
||||||
|
|
||||||
- name: Set up Python 3.
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: Install test dependencies.
|
|
||||||
run: pip3 install ansible molecule[docker] docker
|
|
||||||
|
|
||||||
- name: Run Molecule tests.
|
|
||||||
run: molecule test
|
|
||||||
env:
|
|
||||||
PY_COLORS: '1'
|
|
||||||
ANSIBLE_FORCE_COLOR: '1'
|
|
||||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
|
|
@ -1,38 +0,0 @@
|
||||||
---
|
|
||||||
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
|
|
||||||
# repository or organization.
|
|
||||||
#
|
|
||||||
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
|
|
||||||
# See: https://github.com/ansible/galaxy/issues/46
|
|
||||||
|
|
||||||
name: Release
|
|
||||||
'on':
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: 'geerlingguy.dotfiles'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
release:
|
|
||||||
name: Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out the codebase.
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
path: 'geerlingguy.dotfiles'
|
|
||||||
|
|
||||||
- name: Set up Python 3.
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: Install Ansible.
|
|
||||||
run: pip3 install ansible-base
|
|
||||||
|
|
||||||
- name: Trigger a new import on Galaxy.
|
|
||||||
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
|
|
3
roles/geerlingguy.dotfiles/.gitignore
vendored
3
roles/geerlingguy.dotfiles/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
*.retry
|
|
||||||
*/__pycache__
|
|
||||||
*.pyc
|
|
|
@ -1,11 +0,0 @@
|
||||||
---
|
|
||||||
extends: default
|
|
||||||
|
|
||||||
rules:
|
|
||||||
line-length:
|
|
||||||
max: 120
|
|
||||||
level: warning
|
|
||||||
|
|
||||||
ignore: |
|
|
||||||
.github/stale.yml
|
|
||||||
.travis.yml
|
|
|
@ -1,20 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2017 Jeff Geerling
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,56 +0,0 @@
|
||||||
# Ansible Role: Dotfiles
|
|
||||||
|
|
||||||
[![CI](https://github.com/geerlingguy/ansible-role-dotfiles/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-dotfiles/actions?query=workflow%3ACI)
|
|
||||||
|
|
||||||
Installs a set of dotfiles from a given Git repository. By default, it will install my (geerlingguy's) [dotfiles](https://github.com/geerlingguy/dotfiles), but you can use any set of dotfiles you'd like, as long as they follow a conventional format.
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
Requires `git` on the managed machine (you can easily install it with `geerlingguy.git` if required).
|
|
||||||
|
|
||||||
## Role Variables
|
|
||||||
|
|
||||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
|
||||||
|
|
||||||
dotfiles_repo: "https://github.com/geerlingguy/dotfiles.git"
|
|
||||||
dotfiles_repo_version: master
|
|
||||||
|
|
||||||
The git repository and branch/tag/commit hash to use for retrieving dotfiles. Dotfiles should generally be laid out within the root directory of the repository.
|
|
||||||
|
|
||||||
dotfiles_repo_accept_hostkey: false
|
|
||||||
|
|
||||||
Add the hostkey for the repo url if not already added. If ssh_opts contains "-o StrictHostKeyChecking=no", this parameter is ignored.
|
|
||||||
|
|
||||||
dotfiles_repo_local_destination: "~/Documents/dotfiles"
|
|
||||||
|
|
||||||
The local path where the `dotfiles_repo` will be cloned.
|
|
||||||
|
|
||||||
dotfiles_home: "~"
|
|
||||||
|
|
||||||
The home directory where dotfiles will be linked. Generally, the default should work, but in some circumstances, or when running the role as sudo on behalf of another user, you may want to specify the full path.
|
|
||||||
|
|
||||||
dotfiles_files:
|
|
||||||
- .zshrc
|
|
||||||
- .gitignore
|
|
||||||
- .inputrc
|
|
||||||
- .vimrc
|
|
||||||
|
|
||||||
Which files from the dotfiles repository should be linked to the `dotfiles_home`.
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Example Playbook
|
|
||||||
|
|
||||||
- hosts: localhost
|
|
||||||
roles:
|
|
||||||
- { role: geerlingguy.dotfiles }
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT / BSD
|
|
||||||
|
|
||||||
## Author Information
|
|
||||||
|
|
||||||
This role was created in 2015 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
|
|
|
@ -1,12 +0,0 @@
|
||||||
---
|
|
||||||
dotfiles_repo: "https://github.com/geerlingguy/dotfiles.git"
|
|
||||||
dotfiles_repo_version: master
|
|
||||||
dotfiles_repo_accept_hostkey: false
|
|
||||||
dotfiles_repo_local_destination: "~/Documents/dotfiles"
|
|
||||||
|
|
||||||
dotfiles_home: "~"
|
|
||||||
dotfiles_files:
|
|
||||||
- .zshrc
|
|
||||||
- .gitignore
|
|
||||||
- .inputrc
|
|
||||||
- .vimrc
|
|
|
@ -1,28 +0,0 @@
|
||||||
---
|
|
||||||
dependencies: []
|
|
||||||
|
|
||||||
galaxy_info:
|
|
||||||
role_name: dotfiles
|
|
||||||
author: geerlingguy
|
|
||||||
description: Dotfile installation for UNIX/Linux.
|
|
||||||
company: "Midwestern Mac, LLC"
|
|
||||||
license: "license (BSD, MIT)"
|
|
||||||
min_ansible_version: 2.2
|
|
||||||
platforms:
|
|
||||||
- name: GenericUNIX
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
- any
|
|
||||||
- name: GenericBSD
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
- any
|
|
||||||
- name: GenericLinux
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
- any
|
|
||||||
galaxy_tags:
|
|
||||||
- development
|
|
||||||
- system
|
|
||||||
- dotfiles
|
|
||||||
- configuration
|
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
|
|
||||||
pre_tasks:
|
|
||||||
- name: Update apt cache.
|
|
||||||
apt: update_cache=yes cache_valid_time=600
|
|
||||||
when: ansible_os_family == 'Debian'
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- role: geerlingguy.git
|
|
||||||
- role: geerlingguy.dotfiles
|
|
|
@ -1,17 +0,0 @@
|
||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: instance
|
|
||||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
|
||||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
privileged: true
|
|
||||||
pre_build_image: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
- src: geerlingguy.git
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
- name: Ensure dotfiles repository is cloned locally.
|
|
||||||
git:
|
|
||||||
repo: "{{ dotfiles_repo }}"
|
|
||||||
dest: "{{ dotfiles_repo_local_destination }}"
|
|
||||||
version: "{{ dotfiles_repo_version }}"
|
|
||||||
depth: 1
|
|
||||||
|
|
||||||
- name: Ensure all configured dotfiles are links.
|
|
||||||
command: "ls -F {{ dotfiles_home }}/{{ item }}"
|
|
||||||
register: existing_dotfile_info
|
|
||||||
failed_when: false
|
|
||||||
check_mode: false
|
|
||||||
changed_when: false
|
|
||||||
with_items: "{{ dotfiles_files }}"
|
|
||||||
|
|
||||||
- name: Remove existing dotfiles file if a replacement is being linked.
|
|
||||||
file:
|
|
||||||
path: "{{ dotfiles_home }}/{{ dotfiles_files[item.0] }}"
|
|
||||||
state: absent
|
|
||||||
when: "'@' not in item.1.stdout"
|
|
||||||
with_indexed_items: "{{ existing_dotfile_info.results }}"
|
|
||||||
|
|
||||||
- name: Link dotfiles into home folder.
|
|
||||||
file:
|
|
||||||
src: "{{ dotfiles_repo_local_destination }}/{{ item }}"
|
|
||||||
dest: "{{ dotfiles_home }}/{{ item }}"
|
|
||||||
state: link
|
|
||||||
mode: 0644
|
|
||||||
with_items: "{{ dotfiles_files }}"
|
|
1
roles/geerlingguy.pip
Submodule
1
roles/geerlingguy.pip
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit fd6d58a5719a836e89ef64cf22176e37ca312e9c
|
4
roles/geerlingguy.pip/.github/FUNDING.yml
vendored
4
roles/geerlingguy.pip/.github/FUNDING.yml
vendored
|
@ -1,4 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
---
|
|
||||||
github: geerlingguy
|
|
||||||
patreon: geerlingguy
|
|
56
roles/geerlingguy.pip/.github/stale.yml
vendored
56
roles/geerlingguy.pip/.github/stale.yml
vendored
|
@ -1,56 +0,0 @@
|
||||||
# Configuration for probot-stale - https://github.com/probot/stale
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
|
||||||
daysUntilStale: 90
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
|
||||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
|
||||||
daysUntilClose: 30
|
|
||||||
|
|
||||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
|
|
||||||
onlyLabels: []
|
|
||||||
|
|
||||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
|
||||||
exemptLabels:
|
|
||||||
- pinned
|
|
||||||
- security
|
|
||||||
- planned
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a project (defaults to false)
|
|
||||||
exemptProjects: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues in a milestone (defaults to false)
|
|
||||||
exemptMilestones: false
|
|
||||||
|
|
||||||
# Set to true to ignore issues with an assignee (defaults to false)
|
|
||||||
exemptAssignees: false
|
|
||||||
|
|
||||||
# Label to use when marking as stale
|
|
||||||
staleLabel: stale
|
|
||||||
|
|
||||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
|
||||||
limitPerRun: 30
|
|
||||||
|
|
||||||
pulls:
|
|
||||||
markComment: |-
|
|
||||||
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This pull request is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
|
|
||||||
|
|
||||||
issues:
|
|
||||||
markComment: |-
|
|
||||||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
|
|
||||||
|
|
||||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
|
|
||||||
|
|
||||||
unmarkComment: >-
|
|
||||||
This issue is no longer marked for closure.
|
|
||||||
|
|
||||||
closeComment: >-
|
|
||||||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
|
|
3
roles/geerlingguy.pip/.gitignore
vendored
3
roles/geerlingguy.pip/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
*.retry
|
|
||||||
*/__pycache__
|
|
||||||
*.pyc
|
|
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
language: python
|
|
||||||
services: docker
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- ROLE_NAME: pip
|
|
||||||
matrix:
|
|
||||||
- MOLECULE_DISTRO: centos8
|
|
||||||
- MOLECULE_DISTRO: centos7
|
|
||||||
- MOLECULE_DISTRO: fedora32
|
|
||||||
- MOLECULE_DISTRO: ubuntu2004
|
|
||||||
- MOLECULE_DISTRO: ubuntu1804
|
|
||||||
- MOLECULE_DISTRO: debian10
|
|
||||||
|
|
||||||
install:
|
|
||||||
# Install test dependencies.
|
|
||||||
- pip install molecule yamllint ansible-lint docker
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
# Use actual Ansible Galaxy role name for the project directory.
|
|
||||||
- cd ../
|
|
||||||
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
|
|
||||||
- cd geerlingguy.$ROLE_NAME
|
|
||||||
|
|
||||||
script:
|
|
||||||
# Run tests.
|
|
||||||
- molecule test
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue