Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: Playbook 2. Deploy ubuntu on remote server
- hosts: vm_server
- become: yes
- become_method: sudo
- tasks:
- - name: Check and install gpg.
- apt:
- name: gpg
- state: latest
- - name: Get nginx pgp key.
- apt_key:
- url: https://nginx.org/keys/nginx_signing.key
- state: present
- - name: Add repository.
- apt_repository:
- repo: deb http://nginx.org/packages/mainline/ubuntu/ focal nginx
- - name: Add src repository.
- apt_repository:
- repo: deb-src http://nginx.org/packages/mainline/ubuntu/ focal nginx
- -
- - name: FINALY INSTALL NGINX.
- apt:
- name: nginx
- update_cache: yes
- state: latest
- - name: Turn auto-launch nginx and start it.
- service:
- name: nginx
- state: started
- enabled: yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement