Commit 99b8f266 authored by nanahira's avatar nanahira

disable sleep

parent 90204f02
Pipeline #931 failed with stage
in 3 minutes and 54 seconds
--- ---
# tasks file for init # tasks file for init
- name: main tasks - name: utility tasks
include_tasks: '{{item}}.yml' include_tasks: 'utility.yml'
with_items: - name: sshd_config
- utility include_tasks: 'sshd_config.yml'
- sshd_config
- name: detect swap - name: detect swap
shell: 'swapon' shell: 'swapon'
register: swap_result register: swap_result
......
...@@ -38,3 +38,18 @@ ...@@ -38,3 +38,18 @@
- libcudnn7-dev_7.6.5.32-1+cuda10.1_amd64 - libcudnn7-dev_7.6.5.32-1+cuda10.1_amd64
- libcudnn7-doc_7.6.5.32-1+cuda10.1_amd64 - libcudnn7-doc_7.6.5.32-1+cuda10.1_amd64
when: not cudnn_result.files[0] is defined and ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 18 when: not cudnn_result.files[0] is defined and ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 18
- name: nvidia 重启
become: true
shell: reboot
async: 0
poll: 0
register: reboot_result
args:
removes: /var/run/reboot-required
when: reboot
- name: nvidia 重启等待
local_action: wait_for host={{ ansible_ssh_host }} state=started
when: reboot and reboot_result.changed
- name: 重新读取主机信息
setup:
when: reboot and reboot_result.changed
...@@ -54,6 +54,18 @@ ...@@ -54,6 +54,18 @@
become: true become: true
timezone: timezone:
name: Asia/Shanghai name: Asia/Shanghai
- name: disable auto sleep
become: true
file:
path: '/etc/systemd/system/{{item}}.target'
state: link
src: /dev/null
force: true
with_items:
- sleep
- suspend
- hibernate
- hybrid-sleep
- name: set facts for China mirror - name: set facts for China mirror
set_fact: set_fact:
mirror_debian: http://mirrors.tuna.tsinghua.edu.cn mirror_debian: http://mirrors.tuna.tsinghua.edu.cn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment