How do I get the ansible
config for rolly
below?
remote:
[nsaunders@rolly ~]$
[nsaunders@rolly ~]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.2.2004 (Core)
Release: 8.2.2004
Codename: Core
[nsaunders@rolly ~]$
[nsaunders@rolly ~]$ ansible --version
ansible 2.9.13
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/nsaunders/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
[nsaunders@rolly ~]$
[nsaunders@rolly ~]$ show config
bash: show: command not found...
[nsaunders@rolly ~]$
[nsaunders@rolly ~]$ ansible show config
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD]
[--become-user BECOME_USER] [-K] [-i INVENTORY] [--list-hosts]
[-l SUBSET] [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k]
[--private-key PRIVATE_KEY_FILE] [-u REMOTE_USER]
[-c CONNECTION] [-T TIMEOUT]
[--ssh-common-args SSH_COMMON_ARGS]
[--sftp-extra-args SFTP_EXTRA_ARGS]
[--scp-extra-args SCP_EXTRA_ARGS]
[--ssh-extra-args SSH_EXTRA_ARGS] [-C] [--syntax-check] [-D]
[-e EXTRA_VARS] [--vault-id VAULT_IDS]
[--ask-vault-pass | --vault-password-file VAULT_PASSWORD_FILES]
[-f FORKS] [-M MODULE_PATH] [--playbook-dir BASEDIR]
[-a MODULE_ARGS] [-m MODULE_NAME]
pattern
ansible: error: unrecognized arguments: config
[nsaunders@rolly ~]$
local:
nicholas $
nicholas $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
nicholas $
nicholas $ cat first_playbook.yml
---
- name: Network Getting Started First Playbook
connection: network_cli
gather_facts: false
hosts: all
tasks:
- name: Get config for VyOS devices
vyos_facts:
gather_subset: all
- name: Display the config
debug:
msg: "The hostname is {{ ansible_net_hostname }} and the OS is {{ ansible_net_version }}"
nicholas $
nicholas $ yamllint first_playbook.yml
first_playbook.yml
15:81 error line too long (97 > 80 characters) (line-length)
nicholas $
nicholas $ ansible all -i rolly.foo, -c network_cli -u nsaunders -k -m centos_facts -e ansible_network_os=centos
SSH password:
rolly.foo | FAILED! => {
"msg": "network os centos is not supported"
}
nicholas $
referencing:
https://www.ansible.com/blog/getting-started-writing-your-first-playbook