ssh -i /my_id_rsa -o StrictHostKeyChecking=no -t ubuntu@$id 'hostname'
ssh -i /my_id_rsa -o StrictHostKeyChecking=no -t ubuntu@$id '/usr/bin/docker run hello-world'
vps какого из хостингов вы используете
Я думал что сам провайдер доменных имён может напрямую заблочить DNS
nginx_version: "{{ dpkg_data.stdout_lines | select('search', 'Version') | first | default('Version not found') | regex_replace('Version: ', '') }}"
- hosts: APP gather_facts: yes
tasks:
- name: Gather package facts
package_facts:
manager: auto
- name: Get installed package version (example package)
command: "dpkg -s nginx"
register: dpkg_data
changed_when: false
ignore_errors: true
- name: Set fact for nginx version
set_fact:
nginx_version: "{{ dpkg_data.stdout_lines | select('search', 'Version') | first | default('Version not found') }}"
- name: Collect information
set_fact:
host_info: "{{ ansible_hostname }},{{ ansible_default_ipv4.address }},{{ nginx_version | regex_replace('\n', '; ') }}"
- name: Collect information from all hosts
lineinfile:
path: "collected_info.csv"
line: "{{ hostvars[item].host_info }}"
create: yes
with_items: "{{ ansible_play_batch }}"
delegate_to: localhost
run_once: true
- hosts: APP gather_facts: yes
tasks:
- name: Gather package facts
package_facts:
manager: auto
- name: Get installed package version (example package)
command: "dpkg-query --showformat='${Version}' --show nginx"
register: nginx_version
changed_when: false
ignore_errors: true
- name: Collect information
set_fact:
host_info: "{{ ansible_hostname }},{{ ansible_default_ipv4.address }},{{ nginx_version.stdout | regex_replace('\n', '; ') }}"
- name: Collect information from all hosts
lineinfile:
path: "collected_info.csv"
line: "{{ hostvars[item].host_info }}"
create: yes
with_items: "{{ ansible_play_batch }}"
delegate_to: localhost
run_once: true
- hosts: APP
gather_facts: yes
tasks:
- name: Gather package facts
package_facts:
manager: auto
- name: Get version of nginx using shell and grep
shell: "dpkg -s nginx | grep Version | tr -d '\\n'"
register: nginx_version
changed_when: false
- name: Collect information
set_fact:
host_info: "{{ ansible_hostname }},{{ ansible_default_ipv4.address }},{{ nginx_version.stdout | regex_replace('\n', '; ') }}"
- name: Collect information from all hosts
lineinfile:
path: "collected_info.csv"
line: "{{ hostvars[item].host_info }}"
create: yes
with_items: "{{ ansible_play_batch }}"
delegate_to: localhost
run_once: true
И заходить соответственно надо на
https://zabbix.domain.com/zabbix/