Advertisement
Guest User

Untitled

a guest
Feb 25th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.64 KB | None | 0 0
  1. root@joe-vm1:~ # cat ixworkstation.yaml
  2. - hosts: all
  3. user: "root"
  4. vars:
  5. ansible_ssh_port: 22
  6. ansible_python_interpreter: "/usr/local/bin/python3.6"
  7. ansible_port: 22
  8. tasks:
  9. - name: Enable Linux support in /etc/rc.conf
  10. shell: |
  11. sysrc linux_enable="YES"
  12.  
  13. - name: Restart abi service to load Linux kernel module
  14. service: name=abi state=restarted
  15.  
  16. - name: Install packages for workstation role on FreeBSD
  17. pkgng:
  18. name: xorg, kde5, sddm, firefox, thunderbird, libreoffice, nvidia-driver
  19. state: present
  20.  
  21. - name: Enable NVidia support in /etc/rc.conf
  22. shell: |
  23. sysrc kld_list="nvidia-modeset"
  24.  
  25. - name: Restart kld service to load NVidia kernel module
  26. service: name=kld state=restarted
  27.  
  28. - name: Configure /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
  29. lineinfile:
  30. line: "{{ item }}"
  31. path: /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
  32. create: yes
  33. with_items:
  34. - 'Section "Device"'
  35. - ' Identifier "Card0"'
  36. - ' Driver "nvidia"'
  37. - 'EndSection'
  38.  
  39. - name: Enable and start all services for workstation role on FreeBSD
  40. service:
  41. name: "{{ item }}"
  42. enabled: true
  43. state: started
  44. with_items:
  45. - dbus
  46. - sddm
  47. root@joe-vm1:~ # ansible-playbook-3.6 ixworkstation.yaml --ask-pass -v
  48. No config file found; using defaults
  49. SSH password:
  50. /usr/local/etc/ansible/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
  51. /usr/local/etc/ansible/hosts did not meet script requirements, check plugin documentation if this is unexpected
  52.  
  53. PLAY [all] *************************************************************************************************************************************************************************************************************************************************************************************************************************
  54.  
  55. TASK [Gathering Facts] *************************************************************************************************************************************************************************************************************************************************************************************************************
  56. ok: [127.0.0.1]
  57.  
  58. TASK [Enable Linux support in /etc/rc.conf] ****************************************************************************************************************************************************************************************************************************************************************************************
  59. changed: [127.0.0.1] => {"changed": true, "cmd": "sysrc linux_enable=\"YES\"", "delta": "0:00:00.066474", "end": "2019-02-25 11:39:24.896097", "rc": 0, "start": "2019-02-25 11:39:24.829623", "stderr": "", "stderr_lines": [], "stdout": "linux_enable: YES -> YES", "stdout_lines": ["linux_enable: YES -> YES"]}
  60.  
  61. TASK [Restart abi service to load Linux kernel module] *****************************************************************************************************************************************************************************************************************************************************************************
  62. changed: [127.0.0.1] => {"changed": true, "name": "abi", "state": "started"}
  63.  
  64. TASK [Install packages for workstation role on FreeBSD] ****************************************************************************************************************************************************************************************************************************************************************************
  65. ok: [127.0.0.1] => {"changed": false, "msg": "package(s) already present"}
  66.  
  67. TASK [Enable NVidia support in /etc/rc.conf] ***************************************************************************************************************************************************************************************************************************************************************************************
  68. changed: [127.0.0.1] => {"changed": true, "cmd": "sysrc kld_list=\"nvidia-modeset\"", "delta": "0:00:00.067208", "end": "2019-02-25 11:39:27.779570", "rc": 0, "start": "2019-02-25 11:39:27.712362", "stderr": "", "stderr_lines": [], "stdout": "kld_list: nvidia-modeset -> nvidia-modeset", "stdout_lines": ["kld_list: nvidia-modeset -> nvidia-modeset"]}
  69.  
  70. TASK [Restart kld service to load NVidia kernel module] ****************************************************************************************************************************************************************************************************************************************************************************
  71. changed: [127.0.0.1] => {"changed": true, "name": "kld", "state": "started"}
  72.  
  73. TASK [Configure /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf] *****************************************************************************************************************************************************************************************************************************************************************
  74. ok: [127.0.0.1] => (item=Section "Device") => {"backup": "", "changed": false, "item": "Section \"Device\"", "msg": ""}
  75. ok: [127.0.0.1] => (item= Identifier "Card0") => {"backup": "", "changed": false, "item": "\tIdentifier \"Card0\"", "msg": ""}
  76. ok: [127.0.0.1] => (item= Driver "nvidia") => {"backup": "", "changed": false, "item": "\tDriver \"nvidia\"", "msg": ""}
  77. ok: [127.0.0.1] => (item=EndSection) => {"backup": "", "changed": false, "item": "EndSection", "msg": ""}
  78.  
  79. TASK [Enable and start all services for workstation role on FreeBSD] ***************************************************************************************************************************************************************************************************************************************************************
  80. ok: [127.0.0.1] => (item=dbus) => {"changed": false, "enabled": true, "item": "dbus", "name": "dbus", "state": "started"}
  81. ok: [127.0.0.1] => (item=sddm) => {"changed": false, "enabled": true, "item": "sddm", "name": "sddm", "state": "started"}
  82.  
  83. PLAY RECAP *************************************************************************************************************************************************************************************************************************************************************************************************************************
  84. 127.0.0.1 : ok=8 changed=4 unreachable=0 failed=0
  85.  
  86. root@joe-vm1:~ #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement