forked from visheshgargavi/ansible_arth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yum.yml
61 lines (52 loc) · 1.2 KB
/
yum.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
- name: configuring_yum_using_ansible
gather_facts: No
become: true
become_method: sudo
hosts: web2
tasks:
- name: creating_directory
file:
path: "/dvd"
state: directory
mode: "0755"
register: dvd
- name: folder created successfully
debug:
var: dvd
- name: mounting_dvd
mount:
path: /dvd
src: /dev/cdrom
fstype: iso9660
opts: ro,noauto
state: mounted
register: mount_dvd
- name: dvd_mounted successfully
debug:
var: mount_dvd.changed
- name: yum_repo_BaseOS
yum_repository:
name: BaseOS
description: Local_baseos
file: dvd1
baseurl: file:///dvd/BaseOS
gpgcheck: no
- name: yum_repo_AppStream
yum_repository:
name: AppStream
description: Local_appstream
file: dvd2
baseurl: file:///dvd/AppStream
gpgcheck: no
- name: yum_clean_caches
shell: "yum clean all"
register: clean_all
- name: clean_caches
debug:
var: clean_all.stdout_lines
- name: yum_repository
shell: "yum repolist"
register: yum_repo
- name: repo
debug:
var: yum_repo.stdout_lines