20190619 - money168/cobbler GitHub Wiki
https://www.itread01.com/content/1540994722.html
https://www.ibm.com/developerworks/cn/linux/l-cobbler/index.html
https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/422679/
加密密碼生成:
python -c ‘import crypt; print(crypt.crypt(“密碼”))‘
echo “{user_name} ={user_name}” >> /svn/{project_name}/conf/passwd
#Network information
$SNIPPET
%pre
$SNIPPET
$SNIPPET
$SNIPPET
- Enable installation monitoring
$SNIPPET
%end
- hosts: centos7
sudo: yes
tasks:
– name: change hostname
hostname: name=“cobbler”
– name: add localhost to /etc/hosts
lineinfile:
dest: /etc/hosts
regexp: ‘^127\.0\.0\.1[ \t]+locslhost’
line: ‘127.0.0.1 localhost cobbler’
state: present
– name: add a new user
user: name=cobbler state=absent
– name: install libselinux-python
yum: name=libselinux-python state=latest
– name: install epel-release
yum: name=epel-release state=latest
- hosts: web
sudo: yes
tasks:
– name: install apache
yum: name=httpd state=latest
– name: start apache and enabled
service: name=httpd state=started enabled=yes
– name: change owner
file: dest=/var/www/html owner=vagrant recurse=yes
– name: copy index.html
copy: src=./index.html dest=/var/www/html/index.html owner=vagrant
– name: install php packages
yum: name={{item}} state=latest
with_items:
– php
– php-devel
– php-mbstring
– php-mysql
notify:
– restart apache
– name: copy hellp.php
copy: src=./hello.php dest=/var/www/html/hello.php owner=vagrant
handlers:
– name: restart apache
service: name=httpd state=restarted
https://github.com/ngocngv/ansible-cobbler
https://github.com/bertvv/ansible-role-cobbler