mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-05-29 05:37:22 +00:00
Merge pull request #8900 from konstruktoid/ISSUE8890
format ansible code examples and add DNF/YUM key instructions
This commit is contained in:
commit
7d37886ad7
@ -143,28 +143,34 @@ Create a subtask or role files that contribute to an playbook or task.
|
||||
|
||||
```bash
|
||||
- name: Add Microsoft APT key
|
||||
apt_key:
|
||||
keyserver: https://packages.microsoft.com/
|
||||
id: BC528686B50D79E339D3721CEB3E94ADBE1229CF
|
||||
when: ansible_os_family == "Debian"
|
||||
apt_key:
|
||||
keyserver: https://packages.microsoft.com/
|
||||
id: BC528686B50D79E339D3721CEB3E94ADBE1229CF
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Add Microsoft apt repository for MDATP
|
||||
apt_repository:
|
||||
repo: deb [arch=arm64,armhf,amd64] https://packages.microsoft.com/[distro]/[version]/prod [channel] main
|
||||
update_cache: yes
|
||||
state: present
|
||||
filename: microsoft-[channel].list
|
||||
when: ansible_os_family == "Debian"
|
||||
apt_repository:
|
||||
repo: deb [arch=arm64,armhf,amd64] https://packages.microsoft.com/[distro]/[version]/prod [channel] main
|
||||
update_cache: yes
|
||||
state: present
|
||||
filename: microsoft-[channel].list
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Add Microsoft DNF/YUM key
|
||||
rpm_key:
|
||||
state: present
|
||||
key: https://packages.microsoft.com/keys/microsoft.asc
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Add Microsoft yum repository for MDATP
|
||||
yum_repository:
|
||||
name: packages-microsoft-com-prod-[channel]
|
||||
description: Microsoft Defender for Endpoint
|
||||
file: microsoft-[channel]
|
||||
baseurl: https://packages.microsoft.com/[distro]/[version]/[channel]/
|
||||
gpgcheck: yes
|
||||
enabled: Yes
|
||||
when: ansible_os_family == "RedHat"
|
||||
yum_repository:
|
||||
name: packages-microsoft-com-prod-[channel]
|
||||
description: Microsoft Defender for Endpoint
|
||||
file: microsoft-[channel]
|
||||
baseurl: https://packages.microsoft.com/[distro]/[version]/[channel]/
|
||||
gpgcheck: yes
|
||||
enabled: Yes
|
||||
when: ansible_os_family == "RedHat"
|
||||
```
|
||||
|
||||
- Create the Ansible install and uninstall YAML files.
|
||||
@ -176,13 +182,13 @@ Create a subtask or role files that contribute to an playbook or task.
|
||||
```
|
||||
```Output
|
||||
- hosts: servers
|
||||
tasks:
|
||||
- include: ../roles/onboarding_setup.yml
|
||||
- include: ../roles/add_apt_repo.yml
|
||||
- apt:
|
||||
name: mdatp
|
||||
state: latest
|
||||
update_cache: yes
|
||||
tasks:
|
||||
- include: ../roles/onboarding_setup.yml
|
||||
- include: ../roles/add_apt_repo.yml
|
||||
- apt:
|
||||
name: mdatp
|
||||
state: latest
|
||||
update_cache: yes
|
||||
```
|
||||
|
||||
```bash
|
||||
@ -203,13 +209,13 @@ Create a subtask or role files that contribute to an playbook or task.
|
||||
```
|
||||
```Output
|
||||
- hosts: servers
|
||||
tasks:
|
||||
tasks:
|
||||
- include: ../roles/onboarding_setup.yml
|
||||
- include: ../roles/add_yum_repo.yml
|
||||
- yum:
|
||||
name: mdatp
|
||||
state: latest
|
||||
enablerepo: packages-microsoft-com-prod-[channel]
|
||||
name: mdatp
|
||||
state: latest
|
||||
enablerepo: packages-microsoft-com-prod-[channel]
|
||||
```
|
||||
|
||||
```bash
|
||||
@ -219,7 +225,7 @@ Create a subtask or role files that contribute to an playbook or task.
|
||||
- hosts: servers
|
||||
tasks:
|
||||
- yum:
|
||||
name: mdatp
|
||||
name: mdatp
|
||||
state: absent
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user