Update
This commit is contained in:
parent
9bc81f92b4
commit
9087a1ccfa
2 changed files with 48 additions and 1 deletions
37
backup_code.yaml
Normal file
37
backup_code.yaml
Normal file
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
- name: backup code
|
||||
hosts: all
|
||||
become: true
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
|
||||
- name: make backup folder
|
||||
ansible.builtin.file:
|
||||
path: "/code_backup/"
|
||||
owner: "ansibleuser"
|
||||
group: "ansibleuser"
|
||||
mode: '0700'
|
||||
state: "directory"
|
||||
|
||||
- name: delete old file
|
||||
ansible.builtin.file:
|
||||
path: "/code_backup/code_{{ ansible_hostname }}.tgz"
|
||||
state: "absent"
|
||||
|
||||
- name: create archive
|
||||
community.general.archive:
|
||||
dest: "/code_backup/code_{{ ansible_hostname }}.tgz"
|
||||
path: "/var/lib/docker/volumes"
|
||||
owner: "ansibleuser"
|
||||
|
||||
- name: create sudo permision
|
||||
lineinfile:
|
||||
path: "/etc/sudoers.d/root"
|
||||
create: true
|
||||
state: present
|
||||
line: "root ALL=(ansibleuser) NOPASSWD: ALL"
|
||||
|
||||
- name: scp file into safety
|
||||
ansible.builtin.shell: 'scp -o "StrictHostKeyChecking accept-new" /code_backup/code_{{ ansible_hostname }}.tgz ansibleuser@10.10.0.2:/home/backup_ansible/'
|
||||
become: false
|
|
@ -63,13 +63,23 @@
|
|||
|
||||
- name: install slurm
|
||||
dnf:
|
||||
name: slurm,slurm-slurmctld,slurm-slurmdbd,slurm-slurmrestd,slurm-gui,munge,python3-mysql
|
||||
name: munge,python3-mysql
|
||||
state: present
|
||||
update_cache: true
|
||||
skip_broken: true
|
||||
nobest: false
|
||||
allowerasing: true
|
||||
|
||||
|
||||
# - name: install slurm
|
||||
# dnf:
|
||||
# name: slurm,slurm-slurmctld,slurm-slurmdbd,slurm-slurmrestd,slurm-gui,munge,python3-mysql
|
||||
# state: present
|
||||
# update_cache: true
|
||||
# skip_broken: true
|
||||
# nobest: false
|
||||
# allowerasing: true
|
||||
|
||||
- name: install munge server
|
||||
include_tasks: yaml_sub/install_munge_server.yaml
|
||||
|
||||
|
|
Loading…
Reference in a new issue