mirror of
				https://git.lapiole.org/dani/ansible-roles.git
				synced 2025-10-31 02:41:36 +01:00 
			
		
		
		
	Update to 2022-01-24 12:00
This commit is contained in:
		| @@ -1,11 +1,11 @@ | ||||
| --- | ||||
|  | ||||
| # Version to install | ||||
| miniflux_version: 2.0.34 | ||||
| miniflux_version: 2.0.35 | ||||
| # URL of the binary to install | ||||
| miniflux_bin_url: https://github.com/miniflux/v2/releases/download/{{ miniflux_version }}/miniflux-linux-amd64 | ||||
| # Expected sha1 of the binary | ||||
| miniflux_bin_sha1: dd4ef2a91d7e84d8945daf54df9cb7dd05e22b3f | ||||
| miniflux_bin_sha1: b4558abc1252a71e862494a1461104aff9cfcfb8 | ||||
| # Should ansible handle upgrades ? If false, only initial install will be done | ||||
| miniflux_manage_upgrade: True | ||||
|  | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| --- | ||||
|  | ||||
| # Version to deploy | ||||
| nd_version: 0.47.0 | ||||
| nd_version: 0.47.5 | ||||
| # URL of the archive | ||||
| nd_archive_url: https://github.com/navidrome/navidrome/releases/download/v{{ nd_version }}/navidrome_{{ nd_version }}_Linux_x86_64.tar.gz | ||||
| # Expected sha1 of the archive | ||||
| nd_archive_sha1: 3d06456e26953931399d001f1d3c412f48ac9f34 | ||||
| nd_archive_sha1: bbfe114bfb0c71f7d09821c194e3f57b8e93b710 | ||||
|  | ||||
| # Should ansible handle upgrades, or only initial install ? | ||||
| nd_manage_upgrade: True | ||||
|   | ||||
| @@ -10,7 +10,7 @@ pga_src_ip: [] | ||||
| # Root dir where the app will be installed | ||||
| pga_root_dir: /opt/pgadmin4_{{ pga_id }} | ||||
| # Version to deploy | ||||
| pga_version: '6.3' | ||||
| pga_version: '6.4' | ||||
| # URL of the wheel | ||||
| pga_pip_url: https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v{{ pga_version }}/pip/pgadmin4-{{ pga_version }}-py3-none-any.whl | ||||
|  | ||||
|   | ||||
| @@ -1,14 +1,14 @@ | ||||
| --- | ||||
|  | ||||
| # Version to deploy | ||||
| pma_version: 5.1.1 | ||||
| pma_version: 5.1.2 | ||||
| # ID of the instance. Several instances can be installed on the same server | ||||
| # they must have different ID | ||||
| pma_id: "1" | ||||
| # URL from where the archive will be downloaded | ||||
| pma_archive_url: https://files.phpmyadmin.net/phpMyAdmin/{{ pma_version }}/phpMyAdmin-{{ pma_version }}-all-languages.zip | ||||
| # Expected sha256 of the archive, to verify the download | ||||
| pma_archive_sha256: 78a5d93621f9fdfc221a530705025dc79c1abc7a4d6a940a9d0a9a3719d0554c | ||||
| pma_archive_sha256: 7f5d783fedd0d290714b93bd20c8dfff0663fc571445a89c329dfc3d5147ea93 | ||||
| # Should ansible handle upgrades. If False, then only the initial install will be done | ||||
| pma_manage_upgrade: True | ||||
| # Where phpMyAdmin will be installed | ||||
|   | ||||
| @@ -1,5 +1,8 @@ | ||||
| --- | ||||
| zabbix_agent_port: 10050 | ||||
| # Use agent 2 (go) | ||||
| zabbix_agent2: False | ||||
|  | ||||
| # List of servers allowed to connect to the agent (passive checks) | ||||
| zabbix_agent_servers: | ||||
|   - 51.91.175.34 | ||||
| @@ -21,7 +24,7 @@ zabbix_agent_base_conf: | ||||
|   TLSPSKIdentity: "{{ inventory_hostname }}-agent" | ||||
|   TLSConnect: psk | ||||
|   TLSAccept: 'unencrypted,psk' | ||||
|   StartAgents: 5 | ||||
|   StartAgents: 5 # This one will be ignored on agent2 | ||||
| zabbix_agent_extra_conf: {} | ||||
| zabbix_agent_conf: "{{ zabbix_agent_base_conf | combine(zabbix_agent_extra_conf, recursive=True) }}" | ||||
|  | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| --- | ||||
| - name: restart zabbix-agent | ||||
|   service: name=zabbix-agent state=restarted enabled=yes | ||||
|   service: name={{ zabbix_agent2 | ternary('zabbix-agent2', 'zabbix-agent') }} state=restarted | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| --- | ||||
| - name: Deploy Zabbix Agent configuration | ||||
|   template: src=zabbix_agentd.conf.j2 dest=/etc/zabbix/zabbix_agentd.conf | ||||
|   template: src=zabbix_agentd.conf.j2 dest=/etc/zabbix/{{ zabbix_agent2 | ternary('zabbix_agent2.conf', 'zabbix_agentd.conf') }} | ||||
|   notify: restart zabbix-agent | ||||
|   tags: zabbix | ||||
|  | ||||
| - name: Detect if vfs.dev.discovery is supported natively | ||||
|   shell: zabbix_agentd -t vfs.dev.discovery -c /dev/null | grep -q ZBX_NOTSUPPORTED | ||||
|   shell: "{{ zabbix_agent2 | ternary('zabbix_agent2', 'zabbix_agentd') }} -t vfs.dev.discovery -c /dev/null | grep -q ZBX_NOTSUPPORTED" | ||||
|   register: zabbix_dev_disco | ||||
|   failed_when: False | ||||
|   changed_when: False | ||||
|   | ||||
| @@ -7,3 +7,19 @@ | ||||
|     - vars/{{ ansible_distribution }}.yml | ||||
|     - vars/{{ ansible_os_family }}.yml | ||||
|   tags: zabbix | ||||
|  | ||||
| - name: Check if agent is installed | ||||
|   stat: path=/lib/systemd/system/zabbix-agent.service | ||||
|   register: zabbix_agent_installed | ||||
|   tags: zabbix | ||||
|  | ||||
| - name: Check if agent2 is installed | ||||
|   stat: path=/lib/systemd/system/zabbix-agent2.service | ||||
|   register: zabbix_agent2_installed | ||||
|   tags: zabbix | ||||
|  | ||||
| # zabbix-agent2 is only supported on Debian >= 9 | ||||
| - name: Disable agent2 on older Debian | ||||
|   set_fact: zabbix_agent2=False | ||||
|   when: ansible_os_family == 'Debian' and ansible_distribution_major_version is version('9', '<') | ||||
|   tags: zabbix | ||||
|   | ||||
							
								
								
									
										30
									
								
								roles/zabbix_agent/tasks/install.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								roles/zabbix_agent/tasks/install.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| --- | ||||
|  | ||||
| - when: zabbix_agent2 and zabbix_agent_installed.stat.exists | ||||
|   block: | ||||
|     - name: Stop zabbix-agent | ||||
|       service: name=zabbix-agent state=stopped enabled=False | ||||
|  | ||||
|     # Note : don't remove it as it'll be pulled as a dependency of zabbix-agent-addons | ||||
|   tags: zabbix | ||||
|  | ||||
| - when: not zabbix_agent2 and zabbix_agent2_installed.stat.exists | ||||
|   block: | ||||
|     - name: Stop zabbix-agent2 | ||||
|       service: name=zabbix-agent2 state=stopped enabled=False | ||||
|  | ||||
|     - name: Remove zabbix-agent2 | ||||
|       package: | ||||
|         name: | ||||
|           - zabbix-agent2 | ||||
|         state: absent | ||||
|  | ||||
|   tags: zabbix | ||||
|  | ||||
| - name: Install zabbix-agent | ||||
|   package: | ||||
|     name: | ||||
|       - "{{ (zabbix_agent2) | ternary('zabbix-agent2', 'zabbix-agent') }}" | ||||
|     state: "{{ zabbix_agent_update | ternary('latest', 'present') }}" | ||||
|   notify: restart zabbix-agent | ||||
|   tags: zabbix | ||||
| @@ -1,12 +1,5 @@ | ||||
| --- | ||||
|  | ||||
| - name: Install agent and dependencies | ||||
|   apt: | ||||
|     name: "{{ zabbix_agent_packages }}" | ||||
|     state: "{{ zabbix_agent_update | ternary('latest','present') }}" | ||||
|     policy_rc_d: 101 # Prevent the daemon from starting automatically after install | ||||
|   tags: zabbix | ||||
|  | ||||
| - name: Create needed directories | ||||
|   file: path={{ item }} state=directory | ||||
|   with_items: | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| - name: Install Zabbix Agent and additional scripts | ||||
| - name: Install additional scripts | ||||
|   yum: | ||||
|     name: "{{ zabbix_agent_packages }}" | ||||
|     state: "{{ zabbix_agent_update | ternary('latest','present') }}" | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| --- | ||||
|  | ||||
| - include: facts.yml | ||||
| - include: install.yml | ||||
| - include: install_{{ ansible_os_family }}.yml | ||||
| - include: selinux.yml | ||||
|   when: ansible_selinux.status == 'enabled' | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| --- | ||||
| - name: Start Zabbix Agent | ||||
|   service: name=zabbix-agent state=started enabled=True | ||||
|   service: name={{ zabbix_agent2 | ternary('zabbix-agent2', 'zabbix-agent') }} state=started enabled=True | ||||
|   tags: zabbix | ||||
|   | ||||
| @@ -1,4 +1,7 @@ | ||||
| {% for key in zabbix_agent_conf.keys() | list %} | ||||
| {% if zabbix_agent2 and key in ['StartAgents'] %} | ||||
| # Ignoring directive {{ key }}={{ zabbix_agent_conf[key] }} as it's not supported in agent2 | ||||
| {% else %} | ||||
| {% if not zabbix_agent_conf[key] is string and zabbix_agent_conf[key] is iterable %} | ||||
| {% for x in zabbix_agent_conf[key] %} | ||||
| {{ key }}={{ x }} | ||||
| @@ -6,4 +9,5 @@ | ||||
| {% else %} | ||||
| {{ key }}={{ zabbix_agent_conf[key] }} | ||||
| {% endif %} | ||||
| {% endif %} | ||||
| {% endfor %} | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| zabbix_agent_packages: | ||||
|   - zabbix-agent | ||||
|   - openssl | ||||
|   - git | ||||
|   - libconfig-simple-perl | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| zabbix_agent_packages: | ||||
|   - zabbix-agent | ||||
|   - openssl | ||||
|   - git | ||||
|   - libconfig-simple-perl | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| zabbix_agent_packages: | ||||
|   - zabbix-agent | ||||
|   - openssl | ||||
|   - git | ||||
|   - libconfig-simple-perl | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| zabbix_agent_packages: | ||||
|   - zabbix-agent | ||||
|   - zabbix-agent-addons | ||||
|   - policycoreutils-python | ||||
|   - openssl | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| zabbix_agent_packages: | ||||
|   - zabbix-agent | ||||
|   - zabbix-agent-addons | ||||
|   - policycoreutils-python-utils | ||||
|   - openssl | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| --- | ||||
|  | ||||
| zabbix_agent_packages: | ||||
|   - zabbix-agent | ||||
|   - openssl | ||||
|   - git | ||||
|   - libconfig-simple-perl | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Daniel Berteaud
					Daniel Berteaud