Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. ---
  2. - hosts: vdu
  3. tasks:
  4. - name: setting up the ssh key
  5. authorized_key:
  6. user: root
  7. key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCiHXGg3H4cLDoFJK22wpVQlj8Kfe8Ab7jSkl8UbdRCjSWEL0fxR2Tm+ORLTWgEMOKbNJgrrvcMdUwDxTSED0UTsRSlqj5F6EyNrW3RrwIagqvvfLZIf3LfipFRm6K2XKgNnwbsGLhVCXiunfUErb96K0vy4UwE4LBkE+WNTTFBZiSNxwKS1QCeMjDzts58oRzwVRt8litSGvt8v11+1rpsgyhWnv9M9DiFdJhQh9LPD3IcmhtA+La796jA/aXczsybp1i1JhQfjw1OyZj3Tpa749aTY/MJgV79ko1xPNbM0KjpVB/6MZ6hgjK9/lxC3aKmpoBbjFjEeel7zCrGwX5R brain4net@vnfm"
  8. state: present
  9. manage_dir: yes
  10. - name: changing password
  11. user:
  12. name: root
  13. update_password: always
  14. password: "{{ 'p5A8kIKT' | password_hash('sha512') }}"
  15. - name: changing hostname
  16. hostname:
  17. name: zabbixHostname
  18. - name: editing the zabbix-agent's config
  19. lineinfile:
  20. path: /etc/zabbix/zabbix_agentd.conf
  21. regexp: "{{ item.regexp }}"
  22. line: "{{ item.line }}"
  23. with_items:
  24. - { regexp: '^Server=', line: 'Server=zabbixProxy' }
  25. - { regexp: '^ServerActive=', line: 'ServerActive=zabbixProxy' }
  26. - { regexp: '^Hostname=', line: 'Hostname=zabbixHostname' }
  27. - name: restarting the zabbix-agent service
  28. service:
  29. name: zabbix-agent
  30. state: restarted
  31. enabled: yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement