Browse Source

Merge pull request #5 from patchkez/ansible_demo_firewall

Demo - Ansible playbook - firewall-cmd
revert-24-test_rpcbind_to_assetname
patchkez 7 years ago
committed by GitHub
parent
commit
87d398029e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      README.md
  2. 8
      dragonriders/dokomodo/yaml/data.yaml
  3. 11
      playbooks/README.md
  4. 2
      playbooks/inventory
  5. 29
      playbooks/roles/systemtuning/.travis.yml
  6. 38
      playbooks/roles/systemtuning/README.md
  7. 2
      playbooks/roles/systemtuning/defaults/main.yml
  8. 2
      playbooks/roles/systemtuning/handlers/main.yml
  9. 57
      playbooks/roles/systemtuning/meta/main.yml
  10. 15
      playbooks/roles/systemtuning/tasks/main.yml
  11. 2
      playbooks/roles/systemtuning/tests/inventory
  12. 5
      playbooks/roles/systemtuning/tests/test.yml
  13. 2
      playbooks/roles/systemtuning/vars/main.yml
  14. 1
      playbooks/setup_notary_node.retry
  15. 9
      playbooks/setup_notary_node.yml

3
README.md

@ -28,5 +28,8 @@ It was Kolo's idea to create this repository and here is his concept how it shou
### a-team
- complete step-by-step guide with bash installation scripts
### ansible-playbooks
- This is demonstration that central yaml file can be used by other tools. I expect people to start using Ansible for system configuration.
## Contacts
Ideas can be discussed in [#notarynode](https://komodo-platform.slack.com) Slack channel, but please all code proposals discuss via PRs on Github.

8
dragonriders/dokomodo/yaml/data.yaml

@ -84,14 +84,6 @@ assetchains:
amount: 600000000
p2p_port: 10316
rpc_port: 10317
PIZZA:
amount: 100000000
p2p_port:
rpc_port: 11116
BEER:
amount: 100000000
p2p_port:
rpc_port: 8923
NINJA:
amount: 100000000
p2p_port: 15430

11
playbooks/README.md

@ -0,0 +1,11 @@
## Ansible playbooks/roles for setting up Notary Node
This is demonstration that central yaml file can be used by other tools.
### How to use it
- install Ansible localy
- modify inventory file and execute:
```
ansible-playbook -i inventory setup_notary_node.yml -e env=production
```
env is variable which can be set to production or development, check how yaml file with assetchains is structured.

2
playbooks/inventory

@ -0,0 +1,2 @@
[notary_nodes]
mynotarynode ansible_host=192.168.1.1 ansible_user=root ansible_password=secure

29
playbooks/roles/systemtuning/.travis.yml

@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

38
playbooks/roles/systemtuning/README.md

@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

2
playbooks/roles/systemtuning/defaults/main.yml

@ -0,0 +1,2 @@
---
# defaults file for systemtuning

2
playbooks/roles/systemtuning/handlers/main.yml

@ -0,0 +1,2 @@
---
# handlers file for systemtuning

57
playbooks/roles/systemtuning/meta/main.yml

@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

15
playbooks/roles/systemtuning/tasks/main.yml

@ -0,0 +1,15 @@
# tasks file for systemtuning
---
- name: Construct fact
set_fact:
coins: "{{ assetchains[branch] }}"
- name: Configure firewalld for new assetchains
firewalld:
zone: public
port: "{{ item.value.p2p_port }}/tcp"
permanent: true
immediate: true
state: enabled
with_dict: "{{ coins }}"
when: ansible_os_family == "RedHat"

2
playbooks/roles/systemtuning/tests/inventory

@ -0,0 +1,2 @@
localhost

5
playbooks/roles/systemtuning/tests/test.yml

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- systemtuning

2
playbooks/roles/systemtuning/vars/main.yml

@ -0,0 +1,2 @@
---
# vars file for systemtuning

1
playbooks/setup_notary_node.retry

@ -0,0 +1 @@
mynotarynode

9
playbooks/setup_notary_node.yml

@ -0,0 +1,9 @@
- hosts: all
vars:
branch: "{{ env | default('development') }}"
data_file: ../dragonriders/dokomodo/yaml/data.yaml
vars_files:
- "{{ data_file }}"
roles:
- { role: systemtuning }
Loading…
Cancel
Save