User Tools

Site Tools


wiki:ostatni:ansible:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:ostatni:ansible:start [2019/12/10 10:39]
root [Skoleni cz.nic]
wiki:ostatni:ansible:start [2019/12/10 11:07] (current)
root [Skoleni cz.nic]
Line 56: Line 56:
 https://gist.github.com/HalisCz/42752c7f9761946f2187fab63a386706 https://gist.github.com/HalisCz/42752c7f9761946f2187fab63a386706
  
 +**ansible all --inventory "172.29.29.14,172.29.29.15" -a 'cat /etc/os-release'**
 <code> <code>
-ansible all --inventory "172.29.29.14,172.29.29.15-a 'cat /etc/os-release'+172.29.29.15 | SUCCESS | rc=0 >> 
 +NAME="CentOS Linux" 
 +VERSION="7 (Core)" 
 +ID="centos" 
 +ID_LIKE="rhel fedora" 
 +VERSION_ID="7" 
 +PRETTY_NAME="CentOS Linux 7 (Core)" 
 +ANSI_COLOR="0;31" 
 +CPE_NAME="cpe:/o:centos:centos:7" 
 +HOME_URL="https://www.centos.org/" 
 +BUG_REPORT_URL="https://bugs.centos.org/" 
 + 
 +CENTOS_MANTISBT_PROJECT="CentOS-7" 
 +CENTOS_MANTISBT_PROJECT_VERSION="7" 
 +REDHAT_SUPPORT_PRODUCT="centos" 
 +REDHAT_SUPPORT_PRODUCT_VERSION="7" 
 + 
 +172.29.29.14 | SUCCESS | rc=0 >> 
 +NAME="Ubuntu" 
 +VERSION="18.04.3 LTS (Bionic Beaver)" 
 +ID=ubuntu 
 +ID_LIKE=debian 
 +PRETTY_NAME="Ubuntu 18.04.3 LTS" 
 +VERSION_ID="18.04" 
 +HOME_URL="https://www.ubuntu.com/" 
 +SUPPORT_URL="https://help.ubuntu.com/" 
 +BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" 
 +PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" 
 +VERSION_CODENAME=bionic 
 +UBUNTU_CODENAME=bionic 
 </code> </code>
  
-ansible all --inventory "172.29.29.14,172.29.29.15" -m user -a 'name=bob shell=/bin/bash generate_ssh_key=yes'+**ansible all --inventory "172.29.29.14,172.29.29.15" -m user -a 'name=bob shell=/bin/bash generate_ssh_key=yes'**
  
 <code> <code>
Line 96: Line 127:
 </code> </code>
  
 +
 +<code>
 +root@ubuntu:/vagrant_data# ansible all --inventory "172.29.29.14" -m user -a 'name=bob shell=/bin/bash'
 + [WARNING]: Unable to parse /vagrant_data/172.29.29.14 as an inventory source
 +
 + [WARNING]: No inventory was parsed, only implicit localhost is available
 +
 + [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost
 +does not match 'all'
 +</code>
 +<code>
 +root@ubuntu:/vagrant_data# ansible all --inventory "172.29.29.14," -m user -a 'name=bob shell=/bin/bash'
 +172.29.29.14 | SUCCESS => {
 +    "append": false, 
 +    "changed": false, 
 +    "comment": "", 
 +    "group": 1002, 
 +    "home": "/home/bob", 
 +    "move_home": false, 
 +    "name": "bob", 
 +    "shell": "/bin/bash", 
 +    "state": "present", 
 +    "uid": 1002
 +}
 +
 +</code>
wiki/ostatni/ansible/start.1575970792.txt.gz · Last modified: 2019/12/10 10:39 by root