1. 金步国作品集
example for systemd.slice
sudo tee -a /usr/sbin/my-simple-daemon > /dev/null <<EOT #!/bin/bash while true do echo "Welcome this is my test for slice, sleep 5s" sleep 5 done EOT sudo chmod a+x /usr/sbin/my-simple-daemon sudo tee -a /etc/systemd/system/mytest@test-sleep.service > /dev/null <<EOT [Unit] Description= Just a test for slice [Service] # Type= ExecStart=/usr/sbin/my-simple-daemon -d [Install] WantedBy=multi-user.target EOT sudo systemctl start mytest@test-sleep.service sudo systemctl list-units |grep mytest
destroy
sudo systemctl stop mytest@test-sleep.service sudo rm /etc/systemd/system/mytest@test-sleep.service sudo rm /usr/sbin/my-simple-daemon
阮一峰 介绍 Systemd 入门教程:实战篇
2. linux中文手册
3. Freedesktop英文文档
4. parted
Using parted’s resizepart non-interactively on a busy partition
> parted /dev/sda resizepart 2 yes 100%
The yes is in there in order to automatically choose to continue despite the warnings. This doesn't work on Ansible, because it still requires user interaction for the warnings. Note that parted also has a scripted mode (with the -s switch) which doesn't expect any interaction from the user, but that turned out to be buggy in our specific combination of command and options.
The eventual solution was to use an undocumented switch ---pretend-input-tty. Since Ansible uses a TTYless SSH session, and Parted's non-interactive mode doesn't work, this was the only way out.
> parted ---pretend-input-tty /dev/sda resizepart 2 yes 100%
The eventual solution was to use an undocumented switch ---pretend-input-tty
. Since Ansible uses a TTYless SSH session, and Parted’s non-interactive mode doesn’t work, this was the only way out.
Resize partition to maximum using parted in non-interactive mode
Auto expand last partition to use all unallocated space, using parted in batch mode
5. Linux命令大全
6. YAML 语言教程
- Ansible Galaxy
- cli/ansible-galaxy.html
- galaxy/user_guide.html
- ansible-galaxy install
- https://galaxy.ansible.com/
-
ping example"
ansible -i inventory.ini -m ping $ANHOST"
TIPS
-
# get all hosts and some informations ansible-playbook -vv playbook.yml -i inventory.ini --list-hosts ANHOST=controller ansible -i inventory.ini -m ping $ANHOST ansible $ANHOST -i inventory.ini -m import_role -a name=nfd ansible $ANHOST -i inventory.ini -m include_role -a name=nfd PREPATH=. [[ $(basename "$PWD") == "x-openness-experience-kits" ]] && PREPATH=oek ansible $ANHOST -i inventory.ini -m include_tasks -a file=$PREPATH/roles/nfd/tasks/main.yml