-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 10d37b2
Showing
28 changed files
with
652 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
box-example/roles | ||
*.retry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
sudo: required | ||
|
||
env: | ||
- distribution: ubuntu | ||
version: 14.04 | ||
init: /sbin/init | ||
run_opts: "" | ||
playbook: test.yml | ||
- distribution: ubuntu | ||
version: 16.04 | ||
init: /sbin/init | ||
run_opts: "" | ||
playbook: test.yml | ||
|
||
|
||
# whitelist | ||
branches: | ||
only: | ||
- master | ||
- develop | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
# Pull container | ||
- 'sudo docker pull ${distribution}:${version}' | ||
# Customize container | ||
- 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' | ||
|
||
script: | ||
- container_id=$(mktemp) | ||
# Run container in detached state | ||
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' | ||
|
||
# Ansible syntax check. | ||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} --syntax-check' | ||
|
||
# Test role. | ||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}' | ||
|
||
# Test role idempotence. | ||
- > | ||
sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} | ||
| grep -q 'unreachable=0.*failed=0' | ||
&& (echo 'Idempotence test: pass' && exit 0) | ||
|| (echo 'Idempotence test: fail' && exit 1) | ||
# Clean up | ||
- sudo docker stop "$(cat ${container_id})" | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) role contributors | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
sa-secure-automatic-updates | ||
=========================== | ||
|
||
[![Build Status](https://travis-ci.org/softasap/sa-secure-automatic-updates.svg?branch=master)](https://travis-ci.org/softasap/sa-secure-automatic-updates) | ||
|
||
|
||
Forces automatic installation of the security updates on Ubuntu 16.04 LTS servers | ||
|
||
|
||
|
||
Example of use: | ||
```YAML | ||
|
||
- { | ||
role: "sa-secure-automatic-updates" | ||
} | ||
|
||
``` | ||
|
||
Advanced: | ||
```YAML | ||
- { | ||
role: "sa-secure-automatic-updates" | ||
} | ||
``` | ||
|
||
See box-example for standalone installation example | ||
|
||
|
||
Usage with ansible galaxy workflow | ||
---------------------------------- | ||
|
||
If you installed the sa-secure-automatic-updates role using the command | ||
|
||
|
||
` | ||
ansible galaxy install softasap.sa-secure-automatic-updates | ||
` | ||
|
||
the role will be available in the folder library\softasap.sa-vnc-remote-desktop. | ||
Please adjust the path accordingly. | ||
|
||
```YAML | ||
|
||
- { | ||
role: "softasap.sa-secure-automatic-updates" | ||
} | ||
|
||
``` | ||
|
||
|
||
Copyright and license | ||
--------------------- | ||
|
||
Code licensed under the [BSD 3 clause] (https://opensource.org/licenses/BSD-3-Clause) or the [MIT License] (http://opensource.org/licenses/MIT). | ||
|
||
Subscribe for roles updates at [FB] (https://www.facebook.com/SoftAsap/) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "roles/sa-secure-automatic-updates"] | ||
path = roles/sa-secure-automatic-updates | ||
url = https://github.com/softasap/sa-secure-automatic-updates.git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get install python-pip | ||
sudo pip install -U pip | ||
sudo -H pip install ansible | ||
sudo -H pip install prudentia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
|
||
brew install git | ||
brew install python | ||
pip install -U pip | ||
sudo -H pip install ansible | ||
sudo -H pip install prudentia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- hosts: www | ||
|
||
vars: | ||
- root_dir: .. | ||
|
||
|
||
pre_tasks: | ||
- debug: msg="Pre tasks section" | ||
|
||
roles: | ||
- { | ||
role: "sa-secure-automatic-updates" | ||
} | ||
|
||
|
||
tasks: | ||
- debug: msg="Tasks section" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
git config -f .projmodules --get-regexp '^submodule\..*\.path$' > tempfile | ||
|
||
while read -u 3 path_key path | ||
do | ||
url_key=$(echo $path_key | sed 's/\.path/.url/') | ||
url=$(git config -f .projmodules --get "$url_key") | ||
|
||
read -p "Are you sure you want to delete $path and re-initialize as a separate repository? " yn | ||
case $yn in | ||
[Yy]* ) rm -rf $path; git clone $url $path; echo "$path has been initialized";; | ||
[Nn]* ) continue;; | ||
* ) echo "Please answer yes or no.";; | ||
esac | ||
|
||
done 3<tempfile | ||
|
||
rm tempfile | ||
|
||
echo Project was checked out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Static parameters | ||
WORKSPACE=./ | ||
BOX_PLAYBOOK=$WORKSPACE/box.yml | ||
BOX_NAME=sixteen | ||
BOX_ADDRESS=192.168.0.50 | ||
BOX_USER=slavko | ||
BOX_PWD= | ||
|
||
prudentia ssh <<EOF | ||
unregister $BOX_NAME | ||
register | ||
$BOX_PLAYBOOK | ||
$BOX_NAME | ||
$BOX_ADDRESS | ||
$BOX_USER | ||
$BOX_PWD | ||
verbose 4 | ||
set box_address $BOX_ADDRESS | ||
provision $BOX_NAME | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# defaults file for sa-secure-automatic-updates | ||
|
||
role_dir: "{{role_path}}" | ||
updates_notify_email: "root@locahost" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# handlers file for sa-secure-automatic-updates |
Oops, something went wrong.