Advertisement
Guest User

Untitled

a guest
Sep 29th, 2021
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.81 KB | None | 0 0
  1. ---
  2. - name: Playbook 2. Deploy ubuntu on remote server
  3.   hosts: vm_server
  4.   become: yes
  5.   become_method: sudo
  6.  
  7.   tasks:
  8.   - name: Check and install gpg.
  9.     apt:
  10.       name: gpg
  11.       state: latest
  12.  
  13.   - name: Get nginx pgp key.
  14.     apt_key:
  15.       url: https://nginx.org/keys/nginx_signing.key
  16.       state: present
  17.  
  18.   - name: Add repository.
  19.     apt_repository:
  20.       repo: deb http://nginx.org/packages/mainline/ubuntu/ focal nginx
  21.  
  22.   - name: Add src repository.
  23.     apt_repository:
  24.       repo: deb-src http://nginx.org/packages/mainline/ubuntu/ focal nginx
  25.  
  26.   -
  27.  
  28.   - name: FINALY INSTALL NGINX.
  29.     apt:
  30.       name: nginx
  31.       update_cache: yes
  32.       state: latest
  33.  
  34.   - name: Turn auto-launch nginx and start it.
  35.     service:
  36.       name: nginx
  37.       state: started
  38.       enabled: yes
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement