Last active
May 22, 2025 17:19
-
-
Save looselytyped/fd566ba8a08963fa8a7f6a36f5035ea9 to your computer and use it in GitHub Desktop.
First-playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# a playbook is a _list_ of plays | |
# this is the first play, targeting the `frontend` servers | |
- name: Install nginx | |
hosts: frontend | |
tasks: | |
- name: Install nginx | |
# ubuntu based servers | |
ansible.builtin.apt: | |
name: nginx=1.18.0-6ubuntu14.6 | |
state: present | |
update_cache: yes | |
# Remember the `--become` (or `-b`) flag you passed on the command-line earlier? | |
# This is the playbook equivalent of that. | |
become: true | |
- name: Install Java | |
hosts: backend | |
tasks: | |
- name: Install Java 21 | |
# ubuntu based servers | |
ansible.builtin.apt: | |
name: openjdk-21-jdk=21.0.7+6~us1-0ubuntu1~22.04 | |
state: present | |
update_cache: yes | |
# Remember the `--become` (or `-b`) flag you passed on the command-line earlier? | |
# This is the playbook equivalent of that. | |
become: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment