summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ansible.html.markdown88
-rw-r--r--json.html.markdown2
-rw-r--r--perl6.html.markdown2
3 files changed, 46 insertions, 46 deletions
diff --git a/ansible.html.markdown b/ansible.html.markdown
index cb365e0f..5d225a80 100644
--- a/ansible.html.markdown
+++ b/ansible.html.markdown
@@ -3,6 +3,7 @@ category: tool
tool: ansible
contributors:
- ["Jakub Muszynski" , "http://github.com/sirkubax"]
+ - ["Pat Myron" , "https://github.com/patmyron"]
filename: LearnAnsible.txt
---
@@ -108,14 +109,14 @@ There are few commands you should know about
* and other!
### Module
-_program (usally python) that execute, do some work and return proper JSON output_
+A program (usually python) that executes, does some work and returns proper JSON output
-This *program* perform specialized task/action (like manage instances in the cloud, execute shell command).
+This program performs specialized task/action (like manage instances in the cloud, execute shell command).
The simplest module is called `ping` - it just returns a JSON with `pong` message.
Example of modules:
-* Module: `ping` - the simplest module that is usefull to verify host connectivity
+* Module: `ping` - the simplest module that is useful to verify host connectivity
* Module: `shell` - a module that executes shell command on a specified host(s).
Example of execution - `ping`, `shell`
@@ -136,7 +137,7 @@ $ ansible -m command -a 'whoami' all
```
* Module: `file` - performs file operations (stat, link, dir, ...)
-* Module: `raw` - executes a low-down and dirty SSH command, not going through the module subsystem (usefull to install python2.7)
+* Module: `raw` - executes a low-down and dirty SSH command, not going through the module subsystem (useful to install python2.7)
### Task
Execution of a single Ansible **module** is called a **task**
@@ -182,8 +183,8 @@ _Note: Example playbook is explained in the next chapter: 'Roles'
### More on ansible concept
### Inventory
-Inventory is a set of an objects or hosts, against which we are executing our playbooks or single tasks via shell commands
-For this few minutes, lets asume that we are using default ansible inventory (which in Debian based system is placed in /etc/ansible/hosts)
+Inventory is a set of objects or hosts, against which we are executing our playbooks or single tasks via shell commands
+For these few minutes, let's assume that we are using the default ansible inventory (which in Debian based system is placed in /etc/ansible/hosts)
`/etc/ansible/hosts`
```
@@ -207,7 +208,7 @@ some_other_group
A concept called `role` was introduced for parts of the code (playbooks) that should be reusable.
**Role** is a structured way to manage your set of tasks, variables, handlers, default settings, and way more (meta, files, templates).
-Role allows to reuse the same parts of code in multiple plybooks (you can parametrize the role 'further' during it's execution).
+Roles allow reusing the same parts of code in multiple playbooks (you can parametrize the role 'further' during its execution).
It is a great way to introduce `object oriented` management for your applications.
Role can be included in your playbook (executed via your playbook).
@@ -234,10 +235,10 @@ Role can be included in your playbook (executed via your playbook).
#### For remaining examples we would use additional repository
This example install ansible in `virtualenv` so it is independend from a system. You need to initialize it into your shell-context with `source environment.sh` command.
-We are going to use repository with examples: https://github.com/sirkubax/ansible-for-learnXinYminutes
+We are going to use this repository with examples: https://github.com/sirkubax/ansible-for-learnXinYminutes
```bash
-$ # The folowing example contains a shell-prompt to indicate the venv and relative path
+$ # The following example contains a shell-prompt to indicate the venv and relative path
$ git clone git@github.com:sirkubax/ansible-for-learnXinYminutes.git
user@host:~/$ cd ansible-for-learnXinYminutes
user@host:~/ansible-for-learnXinYminutes$ source environment.sh
@@ -268,10 +269,10 @@ roles/
```
#### Role Handlers
-Handlers are a tasks that can be triggered (notified) during execution of a playbook, but they itself execute at the very end of a playbook.
-It is a best way to restart a service, check if application port is active (successfull deployment criteria), etc.
+Handlers are tasks that can be triggered (notified) during execution of a playbook, but they execute at the very end of a playbook.
+It is the best way to restart a service, check if the application port is active (successful deployment criteria), etc.
-Please get familiar how you can use role in simple_apache_role example
+Get familiar with how you can use roles in the simple_apache_role example
```
playbooks/roles/simple_apache_role/
├── tasks
@@ -321,9 +322,9 @@ ansible -m shell -a 'echo "{{ my_variable }}"' -e 'my_variable="{{ lookup("pipe"
### Register and Conditional
#### Register
-Another way to dynamicaly generate the variable content is a `register` command.
-`Register` is also useful to store an output of a task, and use it's value as a logic
-for execution further tasks.
+Another way to dynamically generate the variable content is the `register` command.
+`Register` is also useful to store an output of a task and use its value
+for executing further tasks.
```
(venv) user@host:~/ansible-for-learnXinYminutes$ ansible-playbook playbooks/register_and_when.yml
```
@@ -354,7 +355,7 @@ for execution further tasks.
```
#### Conditionals - when:
-You can define complex logic with Ansible and Jinja functions. Most common is usage of `when:`, with some variable (often dynamicly generated in previous playbook steps with `register` or `lookup`)
+You can define complex logic with Ansible and Jinja functions. Most common is usage of `when:`, with some variable (often dynamically generated in previous playbook steps with `register` or `lookup`)
```yaml
---
@@ -398,7 +399,7 @@ You can limit an execution of your tasks to defined hosts
### Templates
-Template is a powerfull way to deliver some (partially) dynamic content. Ansible uses **Jinja2** langueage to describe the template.
+Templates are a powerful way to deliver some (partially) dynamic content. Ansible uses **Jinja2** language to describe the template.
```jinja2
Some static content
@@ -409,9 +410,9 @@ Some static content
this line item is {{ item }}
{% endfor %}
```
-Jinja may have some limitations, but it is a powerfull tool that you might like.
+Jinja may have some limitations, but it is a powerful tool that you might like.
-Please examine this simple example that install apache2 and generate index.html from the template
+Please examine this simple example that installs apache2 and generates index.html from the template
"playbooks/roles/simple_apache_role/templates/index.html"
```bash
@@ -442,7 +443,7 @@ In fact - jinja is used to template parts of the playbooks too
```
#### Jinja2 filters
-Junja is powerfull. It has built-in many usefull functions.
+Jinja is powerful. It has many built-in useful functions.
```jinja
# get first item of the list
{{ some_list | first() }}
@@ -452,10 +453,10 @@ Junja is powerfull. It has built-in many usefull functions.
[Read More](http://docs.ansible.com/ansible/latest/playbooks_filters.html)
### ansible-vault
-To maintain **ifrastructure as a code** you need to store secrets.
- Ansible provides a way to encrypt the confidential files so you can store it in the repository, yet the files are decrypted in-fly during ansible execution.
+To maintain **infrastructure as code** you need to store secrets.
+ Ansible provides a way to encrypt confidential files so you can store them in the repository, yet the files are decrypted on-the-fly during ansible execution.
-The best way to use the **ansible-vault** is to store the secret in some secure location, and configure ansible to use during runtime.
+The best way to use it is to store the secret in some secure location, and configure ansible to use during runtime.
```bash
# Try (this would fail)
@@ -488,9 +489,9 @@ $ ansible-vault decrypt path/somefile
### dynamic inventory
You might like to know, that you can build your inventory dynamically.
-(For Ansible) inventory is just a JSON with proper structure - if you can deliver that to ansible - anything is possible.
+(For Ansible) inventory is just JSON with proper structure - if you can deliver that to ansible - anything is possible.
-You do not need to invent the wheel - there are plenty ready to use inventory script for most popular Cloud provicers and a lot of in-house popular usecaseses.
+You do not need to reinvent the wheel - there are plenty of ready to use inventory scripts for most popular Cloud providers and a lot of in-house popular usecases.
[AWS example](http://docs.ansible.com/ansible/latest/intro_dynamic_inventory.html#example-aws-ec2-external-inventory-script)
@@ -514,8 +515,8 @@ callback_whitelist = profile_tasks
```
### facts-cache and ansible-cmdb
-You can pool some infrmations of you environment from another hosts.
-If the informations does not change - you may consider using a facts_cache to speed things up.
+You can pull some information about your environment from another hosts.
+If the information does not change - you may consider using a facts_cache to speed things up.
```
vi ansible.cfg
@@ -533,10 +534,10 @@ fact_caching_timeout = 86400
I like to use `jsonfile` as my backend. It allows to use another project
`ansible-cmdb` [(project on github)](https://github.com/fboender/ansible-cmdb) that generates a HTML page of your inventory resources. A nice 'free' addition!
-### debugging ansible [chapter in progres]
+### debugging ansible [chapter in progress]
When your job fails - it is good to be effective with debugging.
-1. Increase verbosiy by using multiple -v **[ -vvvvv]**
+1. Increase verbosity by using multiple -v **[ -vvvvv]**
2. If variable is undefined
- grep -R path_of_your_inventory -e missing_variable
3. If variable (dictionary or a list) is undefined
@@ -544,9 +545,9 @@ When your job fails - it is good to be effective with debugging.
4. Jinja template debug
5. Strange behaviour - try to run the code 'at the destination'
-### Infrastructure as a code
-You already know, that ansible-vault allow you to store your confidential data along with your code (in repository). You can go further - and define your ansible installation and configuration as-a-code.
-See `environment.sh` to learn how to install the ansible itself inside a `virtualenv` that is not attached to your operating system (can be changed by non-privilages user), and as additional benefit - upgrading version of ansible is as easy as installing new version in new virtualenv. What is more, you can have multiple versions of Ansible present in the same time. This is very helpfull!
+### Infrastructure as code
+You already know, that ansible-vault allows you to store your confidential data along with your code (in repository). You can go further - and define your ansible installation and configuration as-a-code.
+See `environment.sh` to learn how to install the ansible itself inside a `virtualenv` that is not attached to your operating system (can be changed by non-privileged user), and as additional benefit - upgrading version of ansible is as easy as installing new version in new virtualenv. What is more, you can have multiple versions of Ansible present at the same time.
```bash
# recreate ansible 2.x venv
@@ -580,10 +581,10 @@ Note: You may like to execute Ansible with `--ask-sudo-pass` or add the user to
## Tips and tricks
#### --check -C
-Always make sure that your playbook can executes in 'dry run' mode (--check), and it's execution is not declaring 'Changed' objects.
+Always make sure that your playbook can execute in 'dry run' mode (--check), and its execution is not declaring 'Changed' objects.
#### --diff -D
-Diff is usefull to see nice detail of the files changed
+Diff is useful to see nice detail of the files changed
It compare 'in memory' the files like `diff -BbruN fileA fileB`
@@ -602,7 +603,7 @@ ansible -m ping web*:!backend:monitoring:&allow_change
#### Tagging
You should tag some (not all) objects - a task in a playbook, all tasks included form a role, etc.
-It allows you to execute the choosen parts of the playbook.
+It allows you to execute the chosen parts of the playbook.
#### no_logs: True
You may see, that some roles print a lot of output in verbose mode. There is also a debug module.
@@ -622,11 +623,11 @@ You can register the output (stdout), rc (return code), stderr of a task with th
## Introduction
-Ansible is (one of the many) orchestration tools. It allows you to controll your environment (infrastructure and a code) and automate the manual tasks.
+Ansible is (one of the many) orchestration tools. It allows you to control your environment (infrastructure and code) and automate the manual tasks.
'You can think as simple as writing in bash with python API
-Of course the rabit hole is way deeper.'
+Of course the rabbit hole is way deeper.'
-Ansible have great integration with multiple operating systems (even Windows) and some hardware (switches, Firewalls, etc). It has multiple tools that integrate with the could providers. Almost every worth-notice cloud provider is present in the ecosystem (AWS, Azure, Google, DigitalOcean, OVH, etc...)
+Ansible has great integration with multiple operating systems (even Windows) and some hardware (switches, Firewalls, etc). It has multiple tools that integrate with the cloud providers. Almost every noteworthy cloud provider is present in the ecosystem (AWS, Azure, Google, DigitalOcean, OVH, etc...)
But ansible is way more! It provides an execution plans, an API, library, callbacks, not forget to mention - COMMUNITY! and great support by developers!
@@ -644,16 +645,15 @@ Official GUI Tool (web inferface) - Ansible Tower - is great, but it is expensiv
It is an agent-less tools In most scenarios, it use ssh as a transport layer.
In some way you can use it as 'bash on steroids'.
-It is very-very-very easy to start. If you are familiar with ssh concept - you already know Ansible (ALMOST). My personal record is: 'I did show "how to install and use ansible" (for simple raspberry pi cluster management) - it took me 30 seconds to deliver a complete working example !!!)'
-I do provide a training services - I'm able to teach a production-ready person - in 8 hours (1 training day)! It covers all needed to work aspects! No other tool can match this ease of use!
+It is very easy to start. If you are familiar with ssh concept - you already know Ansible (ALMOST).
It executes 'as is' - other tools (salt, puppet, chef - might execute in different scenario than you would expect)
Documentation is at the world-class standard!
-The comunity (github, stackOverflow) would help you very fast.
-Writing own modules and extension is fairly easy.
+The community (github, stackOverflow) would help you very fast.
+Writing your own modules and extensions is fairly easy.
Ansible AWX is the open source version of Ansible Tower we have been waiting for, which provides an excellent UI.
#### Neutral
-Migration Ansible<->Salt is failrly easy - so if you would need an event-driven agent environment - it would be a good choice to start quick with Ansible, and convert to salt when needed.
+Migration Ansible<->Salt is fairly easy - so if you would need an event-driven agent environment - it would be a good choice to start quick with Ansible, and convert to salt when needed.
#### Some concepts
@@ -666,4 +666,4 @@ On the other hand - in advanced scope - you can wrap Ansible (use python Ansible
* [Servers For Hackers: An Ansible Tutorial](https://serversforhackers.com/c/an-ansible-tutorial)
* [A system administrator's guide to getting started with Ansible - FAST!](https://www.redhat.com/en/blog/system-administrators-guide-getting-started-ansible-fast)
* [Ansible Tower](https://www.ansible.com/products/tower) - Ansible Tower provides a web UI, dashboard and rest interface to ansible.
-* [Ansible AWX](https://github.com/ansible/awx) - The Open Sourc version of Ansible Tower. \ No newline at end of file
+* [Ansible AWX](https://github.com/ansible/awx) - The Open Source version of Ansible Tower.
diff --git a/json.html.markdown b/json.html.markdown
index 322c7a47..3ec7a3af 100644
--- a/json.html.markdown
+++ b/json.html.markdown
@@ -6,6 +6,7 @@ contributors:
- ["Marco Scannadinari", "https://github.com/marcoms"]
- ["himanshu", "https://github.com/himanshu81494"]
- ["Michael Neth", "https://github.com/infernocloud"]
+ - ["Athanasios Emmanouilidis", "https://github.com/athanasiosem"]
---
JSON is an extremely simple data-interchange format. As [json.org](http://json.org) says, it is easy for humans to read and write and for machines to parse and generate.
@@ -14,7 +15,6 @@ A piece of JSON must represent either:
* A collection of name/value pairs (`{ }`). In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
* An ordered list of values (`[ ]`). In various languages, this is realized as an array, vector, list, or sequence.
- an array/list/sequence (`[ ]`) or a dictionary/object/associated array (`{ }`).
JSON in its purest form has no actual comments, but most parsers will accept C-style (`//`, `/* */`) comments. Some parsers also tolerate a trailing comma (i.e. a comma after the last element of an array or the after the last property of an object), but they should be avoided for better compatibility.
diff --git a/perl6.html.markdown b/perl6.html.markdown
index 04f9c6e3..7c776db4 100644
--- a/perl6.html.markdown
+++ b/perl6.html.markdown
@@ -246,7 +246,7 @@ sub mutate($n is rw) {
}
my $m = 42;
-mutate $m; # $n is now 43 !
+mutate $m; # $m is now 43 !
## This works because we are passing the container $m to mutate. If we try
## to just pass a number instead of passing a variable it won't work because