This shows you the differences between two versions of the page.
| automation:ansible [2023/05/29 13:35] – jotasandoku | automation:ansible [2023/11/02 14:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 87: | Line 87: | ||
| * -a : arguments | * -a : arguments | ||
| - | ansible all -i inventory -m setup # this collects facts | ||
| ansible all -i inventory -m setup # this collects facts | ansible all -i inventory -m setup # this collects facts | ||
| ansible -i hosts all -m ping --private-key / | ansible -i hosts all -m ping --private-key / | ||
| Line 408: | Line 407: | ||
| __ASSERT__ | __ASSERT__ | ||
| \\ | \\ | ||
| - | Checks the **veracity** of an expression. | + | Checks the **veracity** of an expression |
| + | * Also uses these keywords: '' | ||
| \\ | \\ | ||
| Example: | Example: | ||
| - | ~ name: "ASSERT >> Ensure VPN3 RT difference succeeded" | + | ~~~ |
| - | | + | - hosts: localhost |
| - | that: | + | vars_prompt: |
| - | - " | + | - name: filesize |
| - | | + | prompt: "specify file size" |
| + | private: no | ||
| + | | ||
| + | - name: check file size is valid | ||
| + | | ||
| + | | ||
| + | - filesize <= 100 | ||
| + | - filesize >= 1 | ||
| + | fail_msg: "size has to be between 0 and 100!" | ||
| + | | ||
| + | |||
| + | | ||
| Line 446: | Line 457: | ||
| - | __**ROLES** | + | __**ROLES**__ |
| + | * Roles can be downloaded from galaxy as part of collections. | ||
| + | * We can also '' | ||
| + | * first we create the dir with subfolders: defaults, handlers, meta, tasks, templates, vars | ||
| + | * This is an example of a custom role: [[https:// | ||
| + | |||
| + | ansible-galaxy role init < | ||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | __roles for Junos __ | ||
| \\ | \\ | ||
| * Roles (network engine role) act as wrappers. They allows us to use a yaml based parser (command_parser) instead of custom filters. This way, we make the code much shorter. | * Roles (network engine role) act as wrappers. They allows us to use a yaml based parser (command_parser) instead of custom filters. This way, we make the code much shorter. | ||
| Line 509: | Line 531: | ||
| set_fact: | set_fact: | ||
| rt_updates: "{{ int_vrf_list | rt_diff(run_vrf_dict) }}" | rt_updates: "{{ int_vrf_list | rt_diff(run_vrf_dict) }}" | ||
| + | | ||
| + | |||
| + | ---- | ||
| + | __MANAGE FAILURES__ | ||
| + | \\ | ||
| + | * '' | ||
| + | * '' | ||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | ---- | ||
| + | __AWX__ | ||
| + | \\ | ||
| + | * Ansible Tower == AWS =~ ' | ||
| + | * {{ : | ||
| + | * **AWX uses k8s extensively** | ||
| + | Install minikube (ubuntu) with: | ||
| + | minikube start --cpus=4 --memory=6g --addons=ingress --vm-driver=docker | ||