Add files via upload

This commit is contained in:
David Rotermund 2024-04-04 13:54:30 +02:00 committed by GitHub
parent fca4dce088
commit ddc4d0297d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 15 deletions

View file

@ -1,12 +1,12 @@
--- ---
- name: remove other files - name: remove other files
include_tasks: yaml_sub/myrepo_clean.yaml ansible.builtin.include_tasks: yaml_sub/myrepo_clean.yaml
- name: update file myrepo.repo - name: update file myrepo.repo
import_tasks: yaml_sub/myrepo_data.yaml ansible.builtin.import_tasks: yaml_sub/myrepo_data.yaml
- name: install docker rpm - name: install docker rpm
dnf: ansible.builtin.dnf:
name: "docker-ce,docker-ce-cli,docker-ce-rootless-extras,docker-buildx-plugin,docker-compose-plugin,python3,python3-pip,python3-requests" name: "docker-ce,docker-ce-cli,docker-ce-rootless-extras,docker-buildx-plugin,docker-compose-plugin,python3,python3-pip,python3-requests"
state: latest state: latest
update_cache: true update_cache: true
@ -16,7 +16,7 @@
enablerepo: "docker-ce-stable" enablerepo: "docker-ce-stable"
- name: make sure docker service unit is started - name: make sure docker service unit is started
systemd_service: ansible.builtin.systemd_service:
state: started state: started
name: docker name: docker
enabled: true enabled: true

View file

@ -1,6 +1,6 @@
--- ---
- name: Mount /home - name: Mount /home
mount: ansible.posix.mount:
src: 10.10.1.21:/volume1/home_dir src: 10.10.1.21:/volume1/home_dir
path: /home path: /home
opts: rw,sync,hard,nolock opts: rw,sync,hard,nolock
@ -8,7 +8,7 @@
state: mounted state: mounted
fstype: nfs fstype: nfs
- name: Mount /glocal - name: Mount /glocal
mount: ansible.posix.mount:
src: 10.10.1.1:/volume1/glocal src: 10.10.1.1:/volume1/glocal
path: /glocal path: /glocal
opts: rw,sync,hard,nolock opts: rw,sync,hard,nolock
@ -16,7 +16,7 @@
state: mounted state: mounted
fstype: nfs fstype: nfs
- name: Mount /tools - name: Mount /tools
mount: ansible.posix.mount:
src: 10.10.1.1:/volume1/tools src: 10.10.1.1:/volume1/tools
path: /tools path: /tools
opts: rw,sync,hard,nolock opts: rw,sync,hard,nolock
@ -24,7 +24,7 @@
state: mounted state: mounted
fstype: nfs fstype: nfs
- name: Mount /0 - name: Mount /0
mount: ansible.posix.mount:
src: 10.10.1.1:/volume1/data src: 10.10.1.1:/volume1/data
path: /0 path: /0
opts: rw,sync,hard,nolock opts: rw,sync,hard,nolock
@ -32,7 +32,7 @@
state: mounted state: mounted
fstype: nfs fstype: nfs
- name: Mount /sge-root - name: Mount /sge-root
mount: ansible.posix.mount:
src: 10.10.10.16:/sge-root src: 10.10.10.16:/sge-root
path: /sge-root path: /sge-root
opts: rw,sync,hard opts: rw,sync,hard
@ -40,7 +40,7 @@
state: mounted state: mounted
fstype: nfs fstype: nfs
- name: Mount /data_1 - name: Mount /data_1
mount: ansible.posix.mount:
src: 10.10.1.31:/volume1/data src: 10.10.1.31:/volume1/data
path: /data_1 path: /data_1
opts: rw,sync,hard,nolock opts: rw,sync,hard,nolock
@ -48,7 +48,7 @@
state: mounted state: mounted
fstype: nfs fstype: nfs
- name: Mount /web - name: Mount /web
mount: ansible.posix.mount:
src: 10.10.1.1:/volume1/web src: 10.10.1.1:/volume1/web
path: /web path: /web
opts: rw,sync,hard,nolock opts: rw,sync,hard,nolock

View file

@ -1,18 +1,19 @@
--- ---
- name: Find files everything except myrepo.repo - name: Find files everything except myrepo.repo
find: ansible.builtin.find:
paths: /etc/yum.repos.d paths: /etc/yum.repos.d
file_type: file file_type: file
excludes: "myrepo.repo" excludes: "myrepo.repo"
register: output register: output
- name: Delete other files - name: Delete other files
file: ansible.builtin.file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: absent state: absent
loop: "{{ output.files }}" loop: "{{ output.files }}"
- name: Check for marker line - name: Check for marker line
lineinfile: ansible.builtin.lineinfile:
path: /etc/yum.repos.d/myrepo.repo path: /etc/yum.repos.d/myrepo.repo
create: true create: true
state: present state: present
@ -20,7 +21,7 @@
register: marker_check register: marker_check
- name: Delete file if marker is absent - name: Delete file if marker is absent
file: ansible.builtin.file:
path: /etc/yum.repos.d/myrepo.repo path: /etc/yum.repos.d/myrepo.repo
state: absent state: absent
when: marker_check.changed when: marker_check.changed