| Server IP : 23.254.227.96 / Your IP : 216.73.216.21 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/cloudinit/config/__pycache__/ |
Upload File : |
3
��bw
� @ s� U d Z ddlZddlmZ ddlmZ ddlmZmZm Z ddl
mZ ddlm
Z
egZdd d
ed�eed�ge
d
�Zedddddddid�ddiddigidddd�id�Zeee�Z dd� ZdS )zERuncmd: run arbitrary commands at rc.local with output to the console� N)�dedent)�util)�
MetaSchema�get_meta_doc�validate_cloudconfig_schema)�ALL_DISTROS)�PER_INSTANCEZ cc_runcmdZRuncmdzRun arbitrary commandsa, Run arbitrary commands at a rc.local like level with output to the
console. Each item can be either a list or a string. If the item is a
list, it will be properly quoted. Each item is written to
``/var/lib/cloud/instance/runcmd`` to be later interpreted using
``sh``.
Note that the ``runcmd`` module only writes the script to be run
later. The module that actually runs the script is ``scripts-user``
in the :ref:`Final` boot stage.
.. note::
all commands must be proper yaml, so you have to quote any characters
yaml would eat (':' can be problematic)
.. note::
when writing files, do not use /tmp dir as it races with
systemd-tmpfiles-clean LP: #1707222. Use /run/somedir instead.
a runcmd:
- [ ls, -l, / ]
- [ sh, -xc, "echo $(date) ': hello world!'" ]
- [ sh, -c, echo "=========hello world'=========" ]
- ls -l /root
- [ wget, "http://example.org", -O, /tmp/index.html ]
)�id�name�title�description�distrosZexamplesZ frequency�object�runcmdZarrayZoneOf�type�string)r �itemsZnullF� )r r ZadditionalItemsZadditionalPropertiesZminItems)r Z
propertiesc C s� d|kr|j d| � d S t|t� tjj|jd�d�}|d }ytj|�}tj ||d� W n6 t
k
r� } zt|�dj||���W Y d d }~X nX d S )Nr z:Skipping module named %s, no 'runcmd' key in configuration�scriptsi� z"Failed to shellify {} into file {})
�debugr �schema�os�path�joinZ get_ipathr ZshellifyZ
write_file� Exceptionr �format) r
ZcfgZcloud�logZ_argsZout_fn�cmdZcontent�e� r �/usr/lib/python3.6/cc_runcmd.py�handle` s
r! )�__doc__r �textwrapr Z cloudinitr Zcloudinit.config.schemar r r Zcloudinit.distrosr Zcloudinit.settingsr r
�metar r! r r r r �<module> s8