forked from CCCHH/ansible-infra
		
	nginx(role): split up repo setup and install task lists to estab. conv.
Split up repo setup and package installation after all to establish this as a convention (its already done this way in the docker role and was done this way in the nginx role before) to highlight that an external repo is used.
This commit is contained in:
		
					parent
					
						
							
								89f3e55eac
							
						
					
				
			
			
				commit
				
					
						7420ed6010
					
				
			
		
					 5 changed files with 20 additions and 12 deletions
				
			
		|  | @ -1,46 +0,0 @@ | |||
| - name: Ensure gnupg is installed | ||||
|   ansible.builtin.apt: | ||||
|     name: gnupg | ||||
|     state: present | ||||
|   become: true | ||||
| 
 | ||||
| - name: Ensure NGINX signing key is added | ||||
|   ansible.builtin.get_url: | ||||
|     url: https://nginx.org/keys/nginx_signing.key | ||||
|     dest: /etc/apt/trusted.gpg.d/nginx.asc | ||||
|     mode: "0644" | ||||
|     owner: root | ||||
|     group: root | ||||
|   become: true | ||||
| 
 | ||||
| - name: Ensure NGINX APT repository is added | ||||
|   ansible.builtin.apt_repository: | ||||
|     repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/nginx.asc] https://nginx.org/packages/debian/ {{ ansible_distribution_release }} nginx" | ||||
|     state: present | ||||
|   become: true | ||||
| 
 | ||||
| - name: Ensure NGINX APT source repository is added | ||||
|   ansible.builtin.apt_repository: | ||||
|     repo: "deb-src [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/nginx.asc] https://nginx.org/packages/debian/ {{ ansible_distribution_release }} nginx" | ||||
|     state: present | ||||
|   become: true | ||||
| 
 | ||||
| - name: Ensure repository pinning to make sure nginx package gets installed from NGINX repositories is set up | ||||
|   ansible.builtin.copy: | ||||
|     content: | | ||||
|       Package: * | ||||
|       Pin: origin nginx.org | ||||
|       Pin: release o=nginx | ||||
|       Pin-Priority: 900 | ||||
|     dest: /etc/apt/preferences.d/99nginx | ||||
|     owner: root | ||||
|     group: root | ||||
|     mode: "0644" | ||||
|   become: true | ||||
| 
 | ||||
| - name: Ensure nginx is installed | ||||
|   ansible.builtin.apt: | ||||
|     name: nginx | ||||
|     state: present | ||||
|     update_cache: true | ||||
|   become: true | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue