diff --git a/README.md b/README.md index f13412e..472c526 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ -# ad-hoc-commands -An Ansible ad hoc command uses the /usr/bin/ansible command-line tool to automate a single task on one or more managed nodes. ad hoc commands are quick and easy, but they are not reusable. +# Ad-hoc commands on Ansible + +### `File Transfer` +``` +$ ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts" +$ ansible webservers -m file -a "dest=/srv/foo/a.txt mode=600" +$ ansible webservers -m file -a "dest=/srv/foo/b.txt mode=600 owner=mdehaan group=mdehaan" +$ ansible webservers -m file -a "dest=/path/to/c mode=755 owner=mdehaan group=mdehaan state=directory" (The file module can also create directories, similar to mkdir -p) +$ ansible webservers -m file -a "dest=/path/to/c state=absent" (As well as delete directories (recursively) and delete files:) +``` + +### `Basic Commands` +``` +$ ansible prod -m ping -i inventory.yml (verifica se os servers afestados estao up) +$ ansible webservers -m yum -a "name=acme-1.5 state=present" (garante que a versao correta esteja instalada nos servers) +$ ansible webservers -m ansible.builtin.service -a "name=httpd state=started" (garante que o service esteja iniciado) +``` + +### `Manage Services` +``` +ansible prod -m service -a "name=httpd state=started" - Inicia o service desejado. +ansible prod -m service -a "name=httpd state=restarted" - Restarta o service desejado. +ansible prod -m service -a "name=httpd state=stopped" - Pausa o service desejado. +``` + +### `Manage Packages` +``` +ansible prod -m apt -a "name=giropops state=present" - Instala o pacote desejado no servidor +ansible prod -m apt -a "name=giropops-1.2 state=present" - Instala o pacote com a versão desejada +ansible prod -m apt -a "name=giropops state=latest" - Instala a última versão do pacote desejado +ansible prod -m apt -a "name=giropops state=absent" - Desinstala o pacote desejado no servidor +``` + pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy